deep_folding.utils package

Submodules

deep_folding.utils.pytorchtools module

From https://github.com/Bjarten/early-stopping-pytorch/blob/master/pytorchtools.py

class deep_folding.utils.pytorchtools.EarlyStopping(root_dir, patience=7, verbose=False, delta=0)

Bases: object

Early stops the training if validation loss doesn’t improve after a given patience.

save_checkpoint(val_loss, model, root_dir)

Saves model when validation loss decrease.

deep_folding.utils.save_results module

deep_folding.utils.save_results.create_folder(root_dir)

Creates folder in whiche results will be saved in : directory where to create the folder out : / creatin of a folder

deep_folding.utils.save_results.save_logs(input_dict)

Creates and saves a log file with all information of the run in : dico like {module:’python file’

input: {date : ‘’, data: ‘split’ or ‘all’, loss_type :’‘, batch_size: ‘’, nb_epoch:’‘, root_dir:’‘, input_type:’jeff crops or normalized crops’, skeleton: ‘True or False’}, output: {loss_train:’‘, loss_test:’‘}}

deep_folding.utils.split_train_test module

Splits the subjects IDs in a train set and a test set.

Each set is represented as a csv file (train.csv and test.csv). The first column on each row is the subject ID.

deep_folding.utils.split_train_test.get_basename_without_extension(filename)

Returns file basename without extension

deep_folding.utils.split_train_test.main(argv)

Reads argument line and creates cropped files and pickle file

Parameters:argv – a list containing command line arguments
deep_folding.utils.split_train_test.parse_args(argv)

Function parsing command-line arguments

Parameters:argv – a list containing command line arguments
Returns:Namespace
Return type:args
deep_folding.utils.split_train_test.split_train_test(src_dir, tgt_dir, nb_test_subjects)

Splits the subject IDs in train and test

Module contents