ATPESC 2021
2 layer MLP for classifying MNIST using different levels of manual implementation and TensorFlow, Keras API.
mnist_tf_variable_v1.py
: network and layer definitions bassed ontf.Variable
, autodiff viatf.GradientTape
, manual implementation of loss function and SGD, no Keras used beyond loading MNIST dataset.mnist_tf_variable_v2.py
: same as v1, but variables collected in atf.Module
subclass. Should updatetape.gradient()
call to usemodel.trainable_variables
and output a single dictionary of wgrads.mnist_tf_variable_v3.py
: same as v1, but using Kerastf.keras.optimizers
and loss function.mnist_keras.py
: using Keras for everything, includingtf.keras.Sequential
for the model. No use oftf.Variable
ortf.Module