Axon - A Graphical Neural Network Editor
A Computer Science and Robotic Engineering Major Qualifying Project submitted to the Faculty of Worcester Polytechnic Institute in partial fulfillment of the requirements for the degree of Bachelor of Science.
The core project is responsible for understanding the operations the user wants to complete and executing them in the correct order. Typically, the output of the user's commands takes the form of code generation.
This project has a DSL which models the generated code. Project dsl-interface
provides the interface for the components of the DSL. Project dsl
provides
the implementation. Other offshoot projects, such as tasks-yolov3
, add
model-specific implementation details that can be used with the DSL.
The flow of information through the DSL to the generated code is structured as follows:
- Information is input using the DSL via the
ScriptGenerator
. This forms a "program" configuration which completely describes the code which will be generated. - This configuration is checked for correctness by the
ScriptGenerator
insideScriptGenerator.code
. - The configuration is parsed into a
Code
dependency graph usingCodeGraph
, which performs further correctness checks to verify the dependency graph is a singular DAG. - That graph is then traversed and parsed into a program by appending
Code.code
segments in traversal order, predecessors first.
If at any point the ScriptGenerator
or any of its dependencies determines
that the configuration is invalid, an error type is returned.
To add a layer,
- Add it in
SealedLayer
as a sealed subclass. Any parameter validation should be tested. - Add test cases that use it in
DefaultLayerToCodeTest
and then add it as a case inDefaultLayerToCode
. - Use it in
LoadLayersFromHDF5::parseLayer
and amend any tests that now fail because they previously did not understand the new layer type. If no tests fail, add a test that loads a model containing the new layer type.
To add an initializer,
- Add it in
Initializer
as a sealed subclass. - Add a case for it in
DefaultInitializerToCode
. Add test cases inDefaultInitializerToCodeTest
. - Add a case for it in
LoadLayersFromHDF5::initializer
. Generate new models that use each variance of the newInitializer
and add a test inLoadLayersWithInitializersIntegrationTest
that loads each one.
Axon uses a simple plugin system to generalize over many different dataset and models. If you want to add a dataset plugin to process the dataset after it is loaded but before it is given to the model for training, your plugin body must implement this function:
def process_dataset(x, y):
# Do some data processing in here and return the results.
return (x, y)
Inside Axon's autogenerated S3 bucket (named with a prefix axon-autogenerated-
followed by some
random alphanumeric characters for uniqueness), Axon manages these directories:
- axon-untrained-models
- Contains “untrained” models that the user can use to create a new Job with
- These models cannot be used for testing because they are assumed to not contain any weights (or at least not any meaningful weights)
- EC2 pulls untrained models from here when running a training job
- axon-training-results
- File format is
axon-training-results/{job id}/{results files...}
- Contains all results from running a training script
- EC2 uploads trained models here after finishing a training job
- File format is
- axon-test-data
- Contains test data files that can be used with the test view
- Lambda pulls test data files from here
- axon-datasets
- Contains the user's datasets
- EC2 pulls datasets from here for training
- axon-training-scripts
- Contains generated training scripts
- EC2 pulls training scripts from here
- axon-training-progress
- Contains training progress files that Axon polls to get training progress updates
- EC2 writes training progress into here
- File format is
axon-training-progress/{model name}/{dataset name}/progress.txt
- axon-plugins
- Contains directories for each plugin cache
- Unofficial plugins are stored here
- Security Group for ECS named
axon-autogenerated-ecs-sg
- Security Group for EC2 named
axon-autogenerated-ec2-sg
- Security Group for RDS named
axon-autogenerated-rds-sg
- Task role for ECS named
axon-autogenerated-ecs-task-role
- IAM role for EC2 named
axon-autogenerated-ec2-role
- Instance profile for EC2 named
axon-autogenerated-ec2-instance-profile
- ECS Cluster named
axon-autogenerated-cluster
- ECS Task Definition named
axon-autogenerated-task-family