rasbt / deeplearning-models

A collection of various deep learning architectures, models, and tips

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

abhorrent implementation between tf and torch

chentaiyue opened this issue · comments

In following implementations, op max_pool in pytorch uses stride 2. However, op max_pool in tensorflow uses stride 1.
I am confused about it that max_pool should sub-sample signals but in this imlementation it don't have ability.
https://github.com/rasbt/deeplearning-models/blob/master/pytorch_ipynb/cnn/cnn-basic.ipynb
https://github.com/rasbt/deeplearning-models/blob/master/tensorflow1_ipynb/cnn/cnn-basic.ipynb

Thanks you in advance. @rasbt

abhorrent implementation

Lol :). Sorry if that was offensive by any means :).

This wasn't a one-to-one mirroring of the architecture; the number of channels were also different, for example. It was more meant as "here is some example for how to implement some basic CNN in TensorFlow (or PyTorch)." When I implemented the PyTorch version year(s) later, I actually didn't look at the Tf one as a template. I.e., for this repo, I just collected Jupyter notebooks I already had on my computer and I didn't implement the code fresh to make comparisons between Tf and PyTorch.

However, I can see how that can be confusing, so I just made the two CNNs the same. Thanks for the note, I appreciate it :)