/tf_template

My personal TensorFlow model template. Organized into model class, data manager, application.

Primary LanguagePythonMIT LicenseMIT

TensorFlow Model Template

My personal TensorFlow model template.

organization

code

  • data.py : Has the Data Manager class that produces the data in batches for training.
  • model.py : Has the TensorFlow model
  • app.py : The main application code with two modes i.e., (1) train (2) sample

directories

  • log_dir : Summaries from training will be stored here
  • chkpt : Stores model checkpoints which can be used to restore models later

Training the model

$ python app.py --mode train 

Restoring checkpoint and running (sample)

$ python app.py --mode sample

for more info of the command line params run

$ python app.py --help

Running TensorBoard

$ tensorboard --logdir log_dir

TensorBoard generates nice visualization of how the loss function changes over time and also depicts the tf-model graph.