Creating a Training Config for your Model
The Training Configuration in XNAT has several components that pull together several sets of parameters that are used when launching training. You can find the elements of this configuration among the model resources that you downloaded when Installing a Model. Here are the components of the XNAT Training Configuration.
Component | Resource | Description |
---|---|---|
Config Template | config/config_train.json | A pretrained model will have a set of parameters tuned for model training, including the number of epochs and learning rate. Enter those here as a JSON object. |
Config Parameters | (user judgement) | Of the parameters that are made available in the config template, only a few should be made available to users to alter at runtime:
|
Dataset Template | config/dataset_0.json | A pretrained model should have an example dataset object, giving you a template for how to specify files to submit for training. This part of the configuration strips away those actual files, but retains the dataset metadata that your model expects |
Dataset Parameters | (user judgement) | Of the files you submit in your dataset, this set of parameters lets you specify how many (or what percentage) to set as "train", "validate", and/or "test". |
Creating a Training Configuration
- From your project's home page, go to the Machine Learning tab and click the "Open Machine Learning Dashboard" button.
- In the tabs on the left, click Training Configs.
- At the bottom of the listing of installed configurations, click "New Training Configuration". This will take you to the config editor screen:
- Give your config a name in the Label input. Do not use space characters in the label.
- Using the Config Template input will open a code editor, which provides real-time validation of your JSON code. Enter the contents of your config_train.json file here, making any changes as needed.
- Select which configuration parameters should be customizeable at runtime using the checkboxes for Config Parameters. Note that the default settings for these params will come from your Config Template.
- Using the Dataset Template input will open a code editor, which provides real-time validation of your JSON code. Enter the contents of your dataset_0.json file here, then remove the following JSON attributes and their contents:
- numTraining: ## (an integer count of files)
- numTest: ## (an integer count of files)
- test:
[ ... ]
(contains a list of files) - training:
[ ... ]
(contains a list of files) - validation:
[ ... ]
(contains a list of files)
- Select whether to split your dataset up into bundles of "train", "validate", and "test" data by entering integer values into the inputs for Dataset Parameters. If your three integers add up to 100, they will be treated as percentages. If they do not, they will be treated as integer counts of files.
- Save your configuration.
If you go back to the Training Dashboard, you will be able to see your new configuration listed in the table. You can view various aspects of the config, or edit the entire thing.