本文搜集整理了Jupyter Notebook中TensorFlow和PyTorch的各种深度学习架构,模型和技巧,内容非常丰富,适用于Python 3.7,适合当做工具书。
大家可以将内容按照需要进行分割,打印出来,随时查阅。
TensorFlow 1:
https://github.com/rasbt/deeplearning-models/blob/master/tensorflow1_ipynb/basic-ml/perceptron.ipynb
PyTorch:
https://github.com/rasbt/deeplearning-models/blob/master/pytorch_ipynb/basic-ml/perceptron.ipynb
TensorFlow 1:
https://github.com/rasbt/deeplearning-models/blob/master/tensorflow1_ipynb/basic-ml/logistic-regression.ipynb
PyTorch:
https://github.com/rasbt/deeplearning-models/blob/master/pytorch_ipynb/basic-ml/logistic-regression.ipynb
TensorFlow 1:
https://github.com/rasbt/deeplearning-models/blob/master/tensorflow1_ipynb/basic-ml/softmax-regression.ipynb
PyTorch:
https://github.com/rasbt/deeplearning-models/blob/master/pytorch_ipynb/basic-ml/softmax-regression.ipynb
TensorFlow 1:
https://github.com/rasbt/deeplearning-models/blob/master/tensorflow1_ipynb/mlp/mlp-basic.ipynb
PyTorch:
https://github.com/rasbt/deeplearning-models/blob/master/pytorch_ipynb/mlp/mlp-basic.ipynb
TensorFlow 1:
https://github.com/rasbt/deeplearning-models/blob/master/tensorflow1_ipynb/mlp/mlp-dropout.ipynb
PyTorch:
https://github.com/rasbt/deeplearning-models/blob/master/pytorch_ipynb/mlp/mlp-dropout.ipynb
TensorFlow 1:
https://github.com/rasbt/deeplearning-models/blob/master/tensorflow1_ipynb/mlp/mlp-batchnorm.ipynb
PyTorch:
https://github.com/rasbt/deeplearning-models/blob/master/pytorch_ipynb/mlp/mlp-batchnorm.ipynb
TensorFlow 1:
https://github.com/rasbt/deeplearning-models/blob/master/tensorflow1_ipynb/mlp/mlp-lowlevel.ipynb
PyTorch:
https://github.com/rasbt/deeplearning-models/blob/master/pytorch_ipynb/mlp/mlp-fromscratch__sigmoid-mse.ipynb
TensorFlow 1:
https://github.com/rasbt/deeplearning-models/blob/master/tensorflow1_ipynb/cnn/convnet.ipynb
PyTorch:
https://github.com/rasbt/deeplearning-models/blob/master/pytorch_ipynb/cnn/cnn-basic.ipynb
PyTorch:
https://github.com/rasbt/deeplearning-models/blob/master/pytorch_ipynb/cnn/cnn-he-init.ipynb
PyTorch:
https://github.com/rasbt/deeplearning-models/blob/master/pytorch_ipynb/cnn/fc-to-conv.ipynb
PyTorch:
https://github.com/rasbt/deeplearning-models/blob/master/pytorch_ipynb/cnn/cnn-allconv.ipynb
PyTorch:
https://github.com/rasbt/deeplearning-models/blob/master/pytorch_ipynb/cnn/cnn-alexnet-cifar10.ipynb
TensorFlow 1:
https://github.com/rasbt/deeplearning-models/blob/master/tensorflow1_ipynb/cnn/cnn-vgg16.ipynb
PyTorch:
https://github.com/rasbt/deeplearning-models/blob/master/pytorch_ipynb/cnn/cnn-vgg16.ipynb
PyTorch:
https://github.com/rasbt/deeplearning-models/blob/master/pytorch_ipynb/cnn/cnn-vgg16-celeba.ipynb
PyTorch:
https://github.com/rasbt/deeplearning-models/blob/master/pytorch_ipynb/cnn/cnn-vgg19.ipynb
PyTorch:
https://github.com/rasbt/deeplearning-models/blob/master/pytorch_ipynb/cnn/resnet-ex-1.ipynb
PyTorch:
https://github.com/rasbt/deeplearning-models/blob/master/pytorch_ipynb/cnn/cnn-resnet18-mnist.ipynb
PyTorch:
https://github.com/rasbt/deeplearning-models/blob/master/pytorch_ipynb/cnn/cnn-resnet18-celeba-dataparallel.ipynb
PyTorch:
https://github.com/rasbt/deeplearning-models/blob/master/pytorch_ipynb/cnn/cnn-resnet34-mnist.ipynb
PyTorch:
https://github.com/rasbt/deeplearning-models/blob/master/pytorch_ipynb/cnn/cnn-resnet34-celeba-dataparallel.ipynb
PyTorch:
https://github.com/rasbt/deeplearning-models/blob/master/pytorch_ipynb/cnn/cnn-resnet50-mnist.ipynb
PyTorch:
https://github.com/rasbt/deeplearning-models/blob/master/pytorch_ipynb/cnn/cnn-resnet50-celeba-dataparallel.ipynb
PyTorch:
https://github.com/rasbt/deeplearning-models/blob/master/pytorch_ipynb/cnn/cnn-resnet101-celeba.ipynb
PyTorch:
https://github.com/rasbt/deeplearning-models/blob/master/pytorch_ipynb/cnn/cnn-resnet152-celeba.ipynb
PyTorch:
https://github.com/rasbt/deeplearning-models/blob/master/pytorch_ipynb/cnn/nin-cifar10.ipynb
TensorFlow 1:
https://github.com/rasbt/deeplearning-models/blob/master/tensorflow1_ipynb/metric/siamese-1.ipynb
全连接自动编码机
自动编码机
TensorFlow 1:
https://github.com/rasbt/deeplearning-models/blob/master/tensorflow1_ipynb/autoencoder/autoencoder.ipynb
PyTorch:
https://github.com/rasbt/deeplearning-models/blob/master/pytorch_ipynb/autoencoder/ae-basic.ipynb
TensorFlow 1:
https://github.com/rasbt/deeplearning-models/blob/master/tensorflow1_ipynb/autoencoder/ae-deconv.ipynb
PyTorch:
https://github.com/rasbt/deeplearning-models/blob/master/pytorch_ipynb/autoencoder/ae-deconv.ipynb
PyTorch:
https://github.com/rasbt/deeplearning-models/blob/master/pytorch_ipynb/autoencoder/aer-deconv-nopool.ipynb
具有最近邻插值的卷积自动编码机
TensorFlow 1:
https://github.com/rasbt/deeplearning-models/blob/master/tensorflow1_ipynb/autoencoder/autoencoder-conv-nneighbor.ipynb
PyTorch:
https://github.com/rasbt/deeplearning-models/blob/master/pytorch_ipynb/autoencoder/ae-conv-nneighbor.ipynb
PyTorch:
https://github.com/rasbt/deeplearning-models/blob/master/pytorch_ipynb/autoencoder/ae-conv-nneighbor-celeba.ipynb
PyTorch:
https://github.com/rasbt/deeplearning-models/blob/master/pytorch_ipynb/autoencoder/ae-conv-nneighbor-quickdraw-1.ipynb
PyTorch:
https://github.com/rasbt/deeplearning-models/blob/master/pytorch_ipynb/autoencoder/ae-var.ipynb
PyTorch:
https://github.com/rasbt/deeplearning-models/blob/master/pytorch_ipynb/autoencoder/ae-conv-var.ipynb
PyTorch:
https://github.com/rasbt/deeplearning-models/blob/master/pytorch_ipynb/autoencoder/ae-cvae.ipynb
PyTorch:
https://github.com/rasbt/deeplearning-models/blob/master/pytorch_ipynb/autoencoder/ae-cvae_no-out-concat.ipynb
PyTorch:
https://github.com/rasbt/deeplearning-models/blob/master/pytorch_ipynb/autoencoder/ae-cnn-cvae.ipynb
PyTorch:
https://github.com/rasbt/deeplearning-models/blob/master/pytorch_ipynb/autoencoder/ae-cnn-cvae_no-out-concat.ipynb
MNIST上完全连接的GAN
TensorFlow 1:
https://github.com/rasbt/deeplearning-models/blob/master/tensorflow1_ipynb/gan/gan.ipynb
PyTorch:
https://github.com/rasbt/deeplearning-models/blob/master/pytorch_ipynb/gan/gan.ipynb
MNIST上的卷积GAN
TensorFlow 1:
https://github.com/rasbt/deeplearning-models/blob/master/tensorflow1_ipynb/gan/gan-conv.ipynb
PyTorch:
https://github.com/rasbt/deeplearning-models/blob/master/pytorch_ipynb/gan/gan-conv.ipynb
具有标签平滑的MNIST上的卷积GAN
PyTorch:
https://github.com/rasbt/deeplearning-models/blob/master/pytorch_ipynb/gan/gan-conv-smoothing.ipynb
RNN
Many-to-one: Sentiment Analysis / Classification
A simple single-layer RNN (IMDB)
PyTorch:
https://github.com/rasbt/deeplearning-models/blob/master/pytorch_ipynb/rnn/rnn_simple_imdb.ipynb
A simple single-layer RNN with packed sequences to ignore padding characters (IMDB)
PyTorch:
https://github.com/rasbt/deeplearning-models/blob/master/pytorch_ipynb/rnn/rnn_simple_packed_imdb.ipynb
RNN with LSTM cells (IMDB)
PyTorch:
https://github.com/rasbt/deeplearning-models/blob/master/pytorch_ipynb/rnn/rnn_lstm_packed_imdb.ipynb
RNN with LSTM cells and Own Dataset in CSV Format (IMDB)
PyTorch:
https://github.com/rasbt/deeplearning-models/blob/master/pytorch_ipynb/rnn/rnn_lstm_packed_own_csv_imdb.ipynb
RNN with GRU cells (IMDB)
PyTorch:
https://github.com/rasbt/deeplearning-models/blob/master/pytorch_ipynb/rnn/rnn_gru_packed_imdb.ipynb
Multilayer bi-directional RNN (IMDB)
PyTorch:
https://github.com/rasbt/deeplearning-models/blob/master/pytorch_ipynb/rnn/rnn_gru_packed_imdb.ipynb
Many-to-Many / Sequence-to-Sequence
A simple character RNN to generate new text (Charles Dickens)
PyTorch:
https://github.com/rasbt/deeplearning-models/blob/master/pytorch_ipynb/rnn/char_rnn-charlesdickens.ipynb
序数回归
Ordinal Regression CNN -CORAL w. ResNet34 on AFAD-Lite
PyTorch:
https://github.com/rasbt/deeplearning-models/blob/master/pytorch_ipynb/ordinal/ordinal-cnn-coral-afadlite.ipynb
Ordinal Regression CNN -Niu et al. 2016 w. ResNet34 on AFAD-Lite
PyTorch:
https://github.com/rasbt/deeplearning-models/blob/master/pytorch_ipynb/ordinal/ordinal-cnn-niu-afadlite.ipynb
Ordinal Regression CNN -Beckham and Pal 2016 w. ResNet34 on AFAD-Lite
PyTorch:
https://github.com/rasbt/deeplearning-models/blob/master/pytorch_ipynb/ordinal/ordinal-cnn-niu-afadlite.ipynb
技巧和窍门
Cyclical Learning Rate
PyTorch:
https://github.com/rasbt/deeplearning-models/blob/master/pytorch_ipynb/tricks/cyclical-learning-rate.ipynb
PyTorch工作流程和机制
自定义数据集
使用PyTorch数据集加载实用程序用于自定义数据集-CSV文件转换为HDF5
PyTorch:
https://github.com/rasbt/deeplearning-models/blob/master/pytorch_ipynb/mechanics/custom-data-loader-csv.ipynb
使用PyTorch数据集加载自定义数据集的实用程序 - 来自CelebA的图像
PyTorch:
https://github.com/rasbt/deeplearning-models/blob/master/pytorch_ipynb/mechanics/custom-data-loader-celeba.ipynb
使用PyTorch数据集加载自定义数据集的实用程序 - 从Quickdraw中提取
PyTorch:
https://github.com/rasbt/deeplearning-models/blob/master/pytorch_ipynb/mechanics/custom-data-loader-quickdraw.ipynb
使用PyTorch数据集加载实用程序用于自定义数据集 - 从街景房号(SVHN)数据集中绘制
PyTorch:
https://github.com/rasbt/deeplearning-models/blob/master/pytorch_ipynb/custom-data-loader-svhn.ipynb
训练和预处理
带固定内存的数据加载
PyTorch:
https://github.com/rasbt/deeplearning-models/blob/master/pytorch_ipynb/cnn/cnn-resnet34-cifar10-pinmem.ipynb
标准化图像
PyTorch:
https://github.com/rasbt/deeplearning-models/blob/master/pytorch_ipynb/cnn/cnn-standardized.ipynb
图像转换示例
PyTorch:
https://github.com/rasbt/deeplearning-models/blob/master/pytorch_ipynb/mechanics/torchvision-transform-examples.ipynb
Char-RNN with Own Text File
PyTorch:
https://github.com/rasbt/deeplearning-models/blob/master/pytorch_ipynb/rnn/char_rnn-charlesdickens.ipynb
Sentiment Classification RNN with Own CSV File
PyTorch:
https://github.com/rasbt/deeplearning-models/blob/master/pytorch_ipynb/rnn/rnn_lstm_packed_own_csv_imdb.ipynb
PyTorch:
https://github.com/rasbt/deeplearning-models/blob/master/pytorch_ipynb/cnn/cnn-vgg16-celeba-data-parallel.ipynb
Sequential API and hooks
PyTorch:
https://github.com/rasbt/deeplearning-models/blob/master/pytorch_ipynb/mlp/mlp-sequential.ipynb
PyTorch:
https://github.com/rasbt/deeplearning-models/blob/master/pytorch_ipynb/mechanics/cnn-weight-sharing.ipynb
PyTorch:
https://github.com/rasbt/deeplearning-models/blob/master/pytorch_ipynb/mlp/plot-jupyter-matplotlib.ipynb
在PyTorch中获取中间变量的渐变
PyTorch:
https://github.com/rasbt/deeplearning-models/blob/master/pytorch_ipynb/mechanics/manual-gradients.ipynb
TensorFlow 1:
https://github.com/rasbt/deeplearning-models/blob/master/tensorflow1_ipynb/mechanics/image-data-chunking-npz.ipynb
TensorFlow 1:
https://github.com/rasbt/deeplearning-models/blob/master/tensorflow1_ipynb/mechanics/image-data-chunking-hdf5.ipynb
TensorFlow 1:
https://github.com/rasbt/deeplearning-models/blob/master/tensorflow1_ipynb/mechanics/tfrecords.ipynb
TensorFlow 1:
https://github.com/rasbt/deeplearning-models/blob/master/tensorflow1_ipynb/mechanics/file-queues.ipynb
TensorFlow 1:
https://github.com/rasbt/deeplearning-models/blob/master/tensorflow1_ipynb/mechanics/dataset-api.ipynb
TensorFlow 1:
https://github.com/rasbt/deeplearning-models/blob/master/tensorflow1_ipynb/mechanics/saving-and-reloading-models.ipynb
参考链接:
https://github.com/rasbt/deeplearning-models