srgan_trainer Module

../_images/srgan.png

SrganTrainer class uses Super-Resolution Using a Generative Adversarial Network model, which is originally proposed in this arXiv 1. Implemented trainer module uses this Git 2 code as reference work.

References

1

https://arxiv.org/abs/1609.04802

2

https://github.com/leftthomas/SRGAN

SrganTrainer class

class farabio.models.superres.srgan.srgan_trainer.SrganTrainer(config)[source]

SrganTrainer trainer class. Override with custom methods here.

Parameters
GanTrainerparent object

Parent object of SrganTrainer

define_data_attr()[source]

Define data related attributes here

define_model_attr()[source]

Define model related attributes here

define_train_attr()[source]

Define training related attributes here

define_log_attr()[source]

Define log related attributes here

define_compute_attr()[source]

Define compute related attributes here

define_misc_attr()[source]

Define miscellaneous attributes here

get_trainloader()[source]

Hook: Retreives training set of torch.utils.data.DataLoader class

get_testloader()[source]

Hook: Retreives test set of torch.utils.data.DataLoader class

build_model()[source]

Build model

Parameters
epochint

current epoch

start_logger()[source]

Hook: Starts logger

on_train_epoch_start()[source]

Hook: On epoch start

train_batch(args)[source]

Hook: batch of training loop

on_start_training_batch(args)[source]

Hook: On training batch start

discriminator_zero_grad()[source]

Hook: Zero gradients of discriminator

discriminator_loss()[source]

Hook: Training action (Put training here)

discriminator_optim_step()[source]

Discriminator optimizer step

generator_zero_grad()[source]

Zero grad

generator_loss()[source]

Hook: Training action (Put training here)

generator_backward()[source]

Hook: sends backward

generator_optim_step()[source]

Discriminator optimizer step

optimizer_zero_grad()[source]

Zero grad

discriminator_backward()[source]

Hook: Discriminator back-propagation

on_end_training_batch()[source]

Hook: On end of training batch

on_epoch_end()[source]

Hook: on epoch end

on_evaluate_epoch_start()[source]

Hook: on evaluation start

evaluate_batch(args)[source]

Hook: batch of evaluation loop

on_evaluate_batch_end()[source]

Hook: On evaluate batch end

on_evaluate_epoch_end()[source]
save_model()[source]

Save model

Parameters
epochint

current epoch

save_csv()[source]
load_model()[source]

Hook: load model

test_batch(model_name)[source]
on_test_start()[source]

Hook: on test start

test_step(test_arg)[source]

Test action (Put test here)

on_test_end()[source]

Hook: on end test