You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+65-61Lines changed: 65 additions & 61 deletions
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
# Simvue Connectors - Template
1
+
# Simvue Plugins - TensorFlow
2
2
3
3
<br/>
4
4
@@ -11,7 +11,7 @@
11
11
</p>
12
12
13
13
<palign="center">
14
-
This is a template repository which allows you to quickly create new Plugins which provide Simvue tracking and monitoring functionality to Python-based simulations.
14
+
This plugin allows you to easily add Simvue tracking and monitoring functionality to the training and testing of ML models built using TensorFlow.
15
15
</p>
16
16
17
17
<divalign="center">
@@ -25,64 +25,15 @@ This is a template repository which allows you to quickly create new Plugins whi
First, make a name for your new plugin. Typically, the module name is of the form `simvue-{software_name}`, and the connector class itself is of the form `{SoftwareName}Run`. Update the `pyproject.toml` file with the name of your module, and also update the directory currently called `simvue_template` with your module name.
32
-
33
-
### Creating the code
34
-
Ideally, the plugin class which you want users to interact with should be made in the `plugin.py` file inside your module, with any extra functionality which it needs to work (but you don't want inside the class itself) put in files inside the `extras` directory. However since there is no set format for plugins (unlike the more rigid structure of connectors), this may change depending on your needs. Make sure you document thoroughly in the README and then examples how you intend for your plugin to be used. Check out any of our premade plugins for ideas:
Also look at the `CONTRIBUTING.md` file for expected coding standards.
39
-
40
-
41
-
### Writing examples
42
-
In the `examples` directory, please provide at least one example of your plugin being used to track your simulation software. Create this example inside a function so that it can be used in the integration tests.
43
-
44
-
### Writing tests
45
-
You should create two types of tests:
46
-
47
-
* Unit tests: Check each element of your plugin independently, such as file parsers and callbacks, each method etc. These should use Pytest.
48
-
* Integration tests: These check the end-to-end functionality of your plugin when used with the actual simulation software. You should parametrize the test to include offline mode, as well as online. You can use the example(s) which you created earlier as the basis for these tests.
49
-
50
-
### CI Workflows
51
-
Inside the `.github` directory, there are a number of workflows already created. You should edit these to work for your plugin. They include:
52
-
53
-
*`test_macos`, `test_ubuntu`, `test_windows`: These run the unit and integration tests, should not need to be altered
54
-
*`deploy`: Automates deployment to test-PyPI and PyPI for tagged releases (see below). You need to update the module names in this file - see the curly brackets.
55
-
56
-
### Deployment
57
-
When you are happy with your plugin and are ready to deploy it to PyPI for the first time, you need to do the following:
58
-
59
-
* Install `poetry` and `twine` if you haven't already: `pip install poetry twine`
60
-
* Check your `pyproject.toml` file is valid by running `poetry check`
61
-
* Install your module: `poetry install`
62
-
* Build the distribution: `poetry build`
63
-
* Go to `test.pypi.org`, create an account, and get a token
64
-
* Upload your package with Twine: `twine upload -r testpypi dist/*`
65
-
* Enter the token when prompted
66
-
* Go to `https://test.pypi.org/project/{your-package-name}`, check it has been published
67
-
* Click 'Manage Project'
68
-
* If you wish to enable automatic deployments, click 'Publishing' -> 'Add a new publisher' and fill in the details for your repository, setting Workflow name to `deploy.yaml` and Environment name to `test_pypi`
69
-
70
-
If this was all successful, repeat with the real PyPI instance at `pypi.org`, using `twine upload dist/*`, and setting the Environment name in the publisher settings to `pypi`.
71
-
72
-
From now on, you can do deployments automatically. Simply:
73
-
74
-
* Update the `pyproject.toml` with a new version number, eg `v1.0.1`
75
-
* Update the CHANGELOG to reflect your newest changes
76
-
* Tag a branch with a semantic version number, eg `git tag v1.0.1`
77
-
* Push the tag: `git push origin v1.0.1`
78
-
79
-
This should automatically start the deployment workflow - check that it completes successfully on the Github UI.
80
-
81
-
### Updating the README
82
-
When finished, delete all of the information above under the 'How to use this template' heading. Then update the information below to be relevant for your plugin:
83
-
84
28
## Implementation
85
-
{List here how your Plugin works, and the things about the simulation it tracks by default.}
29
+
This package provides a custom `TensorVue` callback, which inherits from TensorFlow's `Callback` class. This will do the following when training, testing or validating a model:
30
+
31
+
* Uploads the Python script creating the model as a Code Artifact
32
+
* Uploads the model config as an Input Artifact
33
+
* Uploads parameters about the model as Metadata
34
+
* Uploads the Training Accuracy and Loss after each batch to an Epoch runUploads the Training and Validation Accuracy and Loss after each Epoch to the Simulation run
35
+
* Uploads model checkpoints after each Epoch to the corresponding Epoch run as Output Artifacts(if enabled by the user)
36
+
* Uploads the final model to the Simulation run as an Output Artifact
86
37
87
38
## Installation
88
39
To install and use this plugin, first create a virtual environment:
@@ -95,7 +46,7 @@ source venv/bin/activate
95
46
```
96
47
And then use pip to install this module:
97
48
```
98
-
pip install {your_module_name_here}
49
+
pip install simvue-tensorflow
99
50
```
100
51
101
52
## Configuration
@@ -113,7 +64,60 @@ token = "..."
113
64
The exact contents of both of the above options can be obtained directly by clicking the **Create new run** button on the web UI. Note that the environment variables have preference over the config file.
114
65
115
66
## Usage example
116
-
{Give an example of how to use your plugin, with details such as the actual simulation being run abstracted away to make it as generic as possible.}
0 commit comments