jaw package
Subpackages
Submodules
jaw.JAWModule module
- class JAWTrainer(model, loss, train_loader, val_loader, test_loader, train_func, eval_func)
Abstract class representing a JAW’s style pytorch trainer. Implement this class is the only requirement of a JAW project.
Is registered inside the constructor all parameters that can most likely not change between two training.
Note
Please notice that in the litterature we can find the case of test process before validation, but it’s usually the validation process that precedes the test one. It’s also generally the same method that is use for the validation and the testing process.
- Parameters:
model (torch.nn.Module.) – Model to train.
loss (torch.nn.Module.) – Loss used for train and evaluate the model.
train_loader (torch.utils.data.dataloader.) – Dataloader used for load the training data.
val_loader (torch.utils.data.dataloader.) – Dataloader used for load the data that will be used for testing the training process.
test_loader (torch.utils.data.dataloader.) – Dataloader used for load the data that will be used for validate the model.
train_func (FunctionType.) – the method that handle the train loop.
test_func (FunctionType.) – the method that handle the validation loop.
- get_summary_text(optimizer)
Return the text that will written inside the training summary file.
- abstract launch_training(epochs, device, logdir, prefix)
Declaration of a JAW’s style training workflow.
- Parameters:
epochs (int.) – Number of total training complete epochs.
device (torch.device.) – Pytorch device used for this training.
logdir (str.) – The name of the directory where your models and training info will be saved.
prefix (str.) – Prefix of the training saving directory.
- Return type:
None- Returns:
None.
jaw.JAWProject module
- generate_jaw_project(project_name, root_path)
Generate a new JAW project by copying base files from __template__ folder then replace the placeholder names by the project name.
- Parameters:
project_name (str.) – The name of the project.
root_path (str.) – The root directory of the project.
- Returns:
None.
- main()
Handle the I/O process of the project generation.
- Return type:
None
- snake_to_pascal_case(string)
Translate a snake_case string to a PascalCase string.
- Parameters:
string (str.) – String to translate.
- Returns:
string to PascalCase format.
- Return type:
str.