Basic Tensorflow example¶
This example demonstrates using Simvue to track a simple Python code, in particular:
- Collecting some metadata,
- Saving the Python script,
- Logging some metrics while the training is running,
- Adding some additional metadata containing the final values of the metrics.
The code is based on a dynamic recurrent neural network example - find the original neural network code on Github.
Running the code¶
To run this example, firstly clone the Simvue client GitHub repository:
Create a virtual environment:
Install the required dependencies:
Ensure that Simvue is configured properly, for example by creating a .simvue.toml
file in the Tensorflow directory. Click on Create new run
in the UI for more information.
Run the code:
Explanation¶
To begin with we import the required class:
We next initialise the run and specify metadata:
run = Run()
run.init(metadata={'dataset.num_classes': num_classes,
'dataset.seq_max_len': seq_max_len,
'dataset.seq_min_len': seq_min_len,
'dataset.masking_val': masking_val,
'training.learning_rate': learning_rate,
'training.training_steps': training_steps,
'training.batch_size': batch_size,
'network.num_units': num_units})
The Python code itself is saved:
During the part of the code which carries out the training we log metrics:
Once the training has completed we add some metadata specifying the final values of the metrics:
Finally we finish the run:
Results¶
As well as having a record of metadata associated with the training run you can visualize the metrics in real-time, for example loss: