Repository: Project-MONAI/MONAI

Issue:
Enhance technical highlights for the pure PyTorch components
**Is your feature request related to a problem? Please describe.**
Got the feedback from Kristopher Kersten:
can any pytorch optimizer be used with MONAI? or does it have to be implemented in the monai.optimizers class?
working with Rhino to convert one of their existing models that uses torch.optim's SGD, and they're not exactly sure how to translate to the Novograd optimizer that's in monai.optimizer, hoping they might just be able to use the torch sgd.
Is this documented somewhere in the MONAI docs?  It wasn't obvious to Rhino, and now that I'm digging in a bit trying to help them it also seems not that obvious.  Or maybe this is just assumed since it's all based on Pytorch.

I will enhance our highlights doc to make it clear.


Discussion:

Resolving patch:
diff --git a/monai/engines/evaluator.py b/monai/engines/evaluator.py
--- a/monai/engines/evaluator.py
+++ b/monai/engines/evaluator.py
@@ -130,7 +130,7 @@ class SupervisedEvaluator(Evaluator):
     Args:
         device: an object representing the device on which to run.
         val_data_loader: Ignite engine use data_loader to run, must be Iterable, typically be torch.DataLoader.
-        network: use the network to run model forward.
+        network: network to evaluate in the evaluator, should be regular PyTorch `torch.nn.Module`.
         epoch_length: number of iterations for one epoch, default to `len(val_data_loader)`.
         non_blocking: if True and this copy is between CPU and GPU, the copy may occur asynchronously
             with respect to the host. For other cases, this argument has no effect.
@@ -245,7 +245,7 @@ class EnsembleEvaluator(Evaluator):
         device: an object representing the device on which to run.
         val_data_loader: Ignite engine use data_loader to run, must be Iterable, typically be torch.DataLoader.
         epoch_length: number of iterations for one epoch, default to `len(val_data_loader)`.
-        networks: use the networks to run model forward in order.
+        network: networks to evaluate in order in the evaluator, should be regular PyTorch `torch.nn.Module`.
         pred_keys: the keys to store every prediction data.
             the length must exactly match the number of networks.
         non_blocking: if True and this copy is between CPU and GPU, the copy may occur asynchronously
diff --git a/monai/engines/trainer.py b/monai/engines/trainer.py
--- a/monai/engines/trainer.py
+++ b/monai/engines/trainer.py
@@ -60,9 +60,11 @@ class SupervisedTrainer(Trainer):
         device: an object representing the device on which to run.
         max_epochs: the total epoch number for trainer to run.
         train_data_loader: Ignite engine use data_loader to run, must be Iterable or torch.DataLoader.
-        network: to train with this network.
-        optimizer: the optimizer associated to the network.
-        loss_function: the loss function associated to the optimizer.
+        network: network to train in the trainer, should be regular PyTorch `torch.nn.Module`.
+        optimizer: the optimizer associated to the network, should be regular PyTorch optimizer from `torch.optim`
+            or its subclass.
+        loss_function: the loss function associated to the optimizer, should be regular PyTorch loss,
+            which inherit from `torch.nn.modules.loss`.
         epoch_length: number of iterations for one epoch, default to `len(train_data_loader)`.
         non_blocking: if True and this copy is between CPU and GPU, the copy may occur asynchronously
             with respect to the host. For other cases, this argument has no effect.


Test patch: