MCPcopy Create free account

hub / github.com/branislav1991/PyTorchProjectFramework / functions

Functions71 in github.com/branislav1991/PyTorchProjectFramework

↓ 6 callersMethod__init__
(self, in_ch, out_ch, bilinear=True)
models/segmentation_model.py:49
↓ 5 callersMethodcreate_visdom_connections
If the program could not connect to Visdom server, this function will start a new server at the default port.
utils/visualizer.py:34
↓ 4 callersMethodset_input
Unpack input data from the dataloader and perform necessary pre-processing steps. The implementation here is just a basic setting of input and
models/base_model.py:37
↓ 3 callersFunctioncreate_dataset
Create a dataset given the configuration (loaded from the json file). This function wraps the class CustomDatasetDataLoader. This is the
datasets/__init__.py:33
↓ 3 callersMethodeval
Make models eval mode during test time.
models/base_model.py:88
↓ 3 callersMethodpost_epoch_callback
(self, epoch, visualizer)
models/base_model.py:207
↓ 3 callersMethodpre_epoch_callback
(self, epoch)
models/base_model.py:203
↓ 2 callersMethodbackward
Calculate losses; called in every training iteration.
models/segmentation_model.py:147
↓ 2 callersFunctioncreate_model
Create a model given the configuration. This is the main interface between this package and train.py/validate.py
models/__init__.py:43
↓ 2 callersMethodforward
Run forward pass; called by both functions <optimize_parameters> and <test>.
models/base_model.py:47
↓ 2 callersFunctionparse_configuration
Loads config file if a string was passed and returns the input if a dictionary was passed.
utils/__init__.py:22
↓ 2 callersMethodsetup
Load and print networks; create schedulers.
models/base_model.py:56
↓ 2 callersMethodtest
Forward function used in test time. This function wraps <forward> function in no_grad() so we don't save intermediate steps for backprop
models/base_model.py:95
↓ 2 callersFunctiontransfer_to_device
Transfers pytorch tensors or lists of tensors to GPU. This function is recursive to be able to deal with lists of lists.
utils/__init__.py:10
↓ 1 callersMethodexport
Exports all the networks of the model using JIT tracing. Requires that the input is set.
models/base_model.py:218
↓ 1 callersFunctionfind_dataset_using_name
Import the module "data/[dataset_name]_dataset.py". In the file, the class called DatasetNameDataset() will be instantiated. It has to be a s
datasets/__init__.py:10
↓ 1 callersFunctionfind_model_using_name
Import the module "models/[model_name]_model.py". In the file, the class called DatasetNameModel() will be instantiated. It has to be
models/__init__.py:20
↓ 1 callersMethodget_current_losses
Return traning losses / errors. train.py will print out these errors on console
models/base_model.py:194
↓ 1 callersMethodget_custom_dataloader
Get a custom dataloader (e.g. for exporting the model). This dataloader may use different configurations than the default trai
datasets/__init__.py:70
↓ 1 callersMethodget_hyperparam_result
Returns the final training result for hyperparameter tuning (e.g. best validation loss).
models/base_model.py:211
↓ 1 callersFunctionget_scheduler
Return a learning rate scheduler.
utils/__init__.py:33
↓ 1 callersMethodload_data
(self)
datasets/__init__.py:66
↓ 1 callersMethodload_networks
Load all the networks from the disk.
models/base_model.py:129
↓ 1 callersMethodload_optimizers
Load all the optimizers from the disk.
models/base_model.py:157
↓ 1 callersMethodoptimize_parameters
Calculate losses, gradients, and update network weights; called in every training iteration
models/base_model.py:52
↓ 1 callersMethodplot_current_losses
Display the current losses on visdom display: dictionary of error labels and values. Input params: epoch: Current epoch.
utils/visualizer.py:43
↓ 1 callersMethodplot_current_validation_metrics
Display the current validation metrics on visdom display: dictionary of error labels and values. Input params: epoch: Current epo
utils/visualizer.py:71
↓ 1 callersMethodprint_current_losses
Print current losses on console. Input params: epoch: Current epoch. max_epochs: Maximum number of epochs.
utils/visualizer.py:137
↓ 1 callersMethodprint_networks
Print the total number of parameters in the network and network architecture.
models/base_model.py:170
↓ 1 callersMethodreset
Reset the visualization.
utils/visualizer.py:28
↓ 1 callersMethodsave_networks
Save all the networks to the disk.
models/base_model.py:113
↓ 1 callersMethodsave_optimizers
Save all the optimizers to the disk for restarting training.
models/base_model.py:147
↓ 1 callersFunctiontrain
(config_file, export=True)
train.py:18
↓ 1 callersMethodtrain
Make models train mode during test time.
models/base_model.py:81
↓ 1 callersMethodupdate_learning_rate
Update learning rates for all the networks; called at the end of every epoch
models/base_model.py:104
↓ 1 callersFunctionvalidate
(config_file)
validate.py:15
Method__getitem__
Return a data point (usually data and labels in a supervised setting).
datasets/base_dataset.py:26
Method__getitem__
(self, index)
datasets/segmentation2d_dataset.py:16
Method__init__
Initialize the Visualizer class. Input params: configuration -- stores all the configurations
utils/visualizer.py:12
Method__init__
Initialize the class; save the configuration in the class.
datasets/base_dataset.py:15
Method__init__
(self, configuration)
datasets/segmentation2d_dataset.py:12
Method__init__
(self, configuration)
datasets/__init__.py:52
Method__init__
Initialize the BaseModel class. Parameters: configuration: Configuration dictionary. When creating your custom class, yo
models/base_model.py:13
Method__init__
(self, in_ch, out_ch)
models/segmentation_model.py:12
Method__init__
(self, in_ch, out_ch)
models/segmentation_model.py:28
Method__init__
(self, in_ch, out_ch)
models/segmentation_model.py:37
Method__init__
(self, in_ch, out_ch)
models/segmentation_model.py:75
Method__init__
(self, n_channels, n_classes)
models/segmentation_model.py:92
Method__init__
Initialize the model.
models/segmentation_model.py:120
Method__iter__
Return a batch of data.
datasets/__init__.py:89
Method__len__
Return the total number of images in the dataset.
datasets/base_dataset.py:21
Method__len__
(self)
datasets/segmentation2d_dataset.py:21
Method__len__
Return the number of data in the dataset.
datasets/__init__.py:83
Methodforward
(self, x)
models/segmentation_model.py:23
Methodforward
(self, x)
models/segmentation_model.py:32
Methodforward
(self, x)
models/segmentation_model.py:44
Methodforward
(self, x1, x2)
models/segmentation_model.py:57
Methodforward
(self, x)
models/segmentation_model.py:79
Methodforward
(self, x)
models/segmentation_model.py:105
Methodforward
Run forward pass.
models/segmentation_model.py:141
Methodget_current_visuals
Return visualization images. train.py will display these images.
models/base_model.py:232
Functionget_transform
(opt, method=cv2.INTER_LINEAR)
datasets/base_dataset.py:43
Methodoptimize_parameters
Calculate gradients and update network weights.
models/segmentation_model.py:153
Methodplot_roc_curve
Display the ROC curve. Input params: fpr: False positive rate (1 - specificity). tpr: True positive rate (sensitivity
utils/visualizer.py:98
Methodpost_epoch_callback
Callback to be called after every epoch.
datasets/base_dataset.py:37
Methodpost_epoch_callback
(self, epoch, visualizer)
models/segmentation_model.py:171
Methodpre_epoch_callback
Callback to be called before every epoch.
datasets/base_dataset.py:32
Methodset_requires_grad
Set requies_grad for all the networks to avoid unnecessary computations.
models/base_model.py:184
Methodshow_validation_images
Display validation images. The images have to be in the form of a tensor with [(image, label, prediction), (image, label, prediction), ...] in
utils/visualizer.py:120
Functionstack_all
Stack all iterables of torch tensors in a list (i.e. [[(tensor), (tensor)], [(tensor), (tensor)]])
utils/__init__.py:43
Methodtest
(self)
models/segmentation_model.py:162