diff --git a/docs/examples/DetailedMNIST.md b/docs/examples/DetailedMNIST.md index 2c00f16..86aed17 100644 --- a/docs/examples/DetailedMNIST.md +++ b/docs/examples/DetailedMNIST.md @@ -163,8 +163,8 @@ from leanai.training.losses import SparseCrossEntropyLossFromLogits, Loss class MyLoss(Loss): - def __init__(self, parent: Experiment): - super().__init__(parent) + def __init__(self): + super().__init__() self.loss = SparseCrossEntropyLossFromLogits() def forward(self, y_pred, y_true): @@ -181,6 +181,7 @@ Example: ```python import torch from torch.optim import SGD +from leanai.core.config import DictLike from leanai.core.experiment import Experiment, set_seeds @@ -191,14 +192,14 @@ experiment = Experiment( example_input=torch.zeros((2, 28, 28, 1), dtype=torch.float32), ) experiment.run_training( - load_dataset=dict( + load_dataset=DictLike( type=FashionMNISTDataset, data_path="outputs", ), - build_loss=dict( + build_loss=DictLike( type=MyLoss ), - build_optimizer=dict( + build_optimizer=DictLike( type=SGD, lr=1e-3, ), @@ -227,8 +228,6 @@ LOCAL_RANK: 0 - CUDA_VISIBLE_DEVICES: [0,1] ``` -> **Note**: Unfortunately the progress bar does not work properly in jupyter notebooks. - ## Wrap-Up That is it for the tutorial. You might want to have a look at tensorboard though. Here you go. diff --git a/docs/examples/SimpleMNIST.md b/docs/examples/SimpleMNIST.md index d0f9920..01d8352 100644 --- a/docs/examples/SimpleMNIST.md +++ b/docs/examples/SimpleMNIST.md @@ -25,6 +25,7 @@ Example: import torch from torch.optim import SGD +from leanai.core.config import DictLike from leanai.core.experiment import Experiment, set_seeds from leanai.data.datasets import FashionMNISTDataset from leanai.training.losses import SparseCrossEntropyLossFromLogits @@ -76,14 +77,14 @@ Lastly, do not forget to specify your `batch_size` and `epochs`, which are techn Example: ```python experiment.run_training( - load_dataset=dict( + load_dataset=DictLike( type=FashionMNISTDataset, data_path="outputs", ), - build_loss=dict( + build_loss=DictLike( type=SparseCrossEntropyLossFromLogits, ), - build_optimizer=dict( + build_optimizer=DictLike( type=SGD, lr=1e-3, ), @@ -112,8 +113,6 @@ LOCAL_RANK: 0 - CUDA_VISIBLE_DEVICES: [0,1] ``` -> **Note**: Unfortunately the progress bar does not work properly in jupyter notebooks. - ## Wrap-Up That is it for the tutorial. You might want to have a look at tensorboard though. Here you go. @@ -123,10 +122,4 @@ Example: %load_ext tensorboard %tensorboard --logdir outputs ``` -Output: -``` -The tensorboard extension is already loaded. To reload it, use: - %reload_ext tensorboard - -``` diff --git a/docs/leanai/core/experiment.md b/docs/leanai/core/experiment.md index a2e9a1f..eb33f77 100644 --- a/docs/leanai/core/experiment.md +++ b/docs/leanai/core/experiment.md @@ -70,11 +70,6 @@ This is required, if you execute the code from within the backup in the checkpoi (Default: True) ---- -### *def* **configure_gradient_clipping**(*self*, optimizer: Optimizer, optimizer_idx: int, gradient_clip_val: Optional[Union[int, float]] = None, gradient_clip_algorithm: Optional[str] = None) - -*(no documentation found)* - --- ### *def* **run_training** diff --git a/docs/leanai/data/dataset.md b/docs/leanai/data/dataset.md index 833feaa..e5bb697 100644 --- a/docs/leanai/data/dataset.md +++ b/docs/leanai/data/dataset.md @@ -170,6 +170,8 @@ parser or consider using and inheriting from the SimpleDataset. * **file_provider_iterable**: The iterable file provider providing samples to the parser. * **parser**: The parser converting samples into a usable format. +:transformers: Transformers that are applied on the dataset to convert the format to what the model requires. (Default: []) +:test_mode: A parameter that is passed to the constructor of the transformers (Default: False). --- @@ -187,6 +189,8 @@ parser or consider using and inheriting from the SimpleDataset. * **file_provider_sequence**: The sequence file provider providing samples to the parser. * **parser**: The parser converting samples into a usable format. +:transformers: Transformers that are applied on the dataset to convert the format to what the model requires. (Default: []) +:test_mode: A parameter that is passed to the constructor of the transformers (Default: False). --- @@ -217,6 +221,8 @@ If that is not the case, your code may break somewhere. * **InputType**: A definition of a named tuple that defines the input of the neural network. * **OutputType**: A definition of a named tuple that defines the output of the neural network. * **ignore_file_not_found**: If a file is missing return None instead of an exception. (Default: False). +:transformers: Transformers that are applied on the dataset to convert the format to what the model requires. (Default: []) +:test_mode: A parameter that is passed to the constructor of the transformers (Default: False). --- diff --git a/docs/leanai/training/losses/loss.md b/docs/leanai/training/losses/loss.md index ae4315a..2bfa1b1 100644 --- a/docs/leanai/training/losses/loss.md +++ b/docs/leanai/training/losses/loss.md @@ -11,14 +11,6 @@ --- ## *class* **Loss**(Module) -Create a loss. - -* **parent**: The parent is required for logging. Parent must be of type Loss or Experiment. - - ---- -### *def* **set_parent**(*self*, parent) - *(no documentation found)* --- diff --git a/docs/leanai/training/losses/multiloss.md b/docs/leanai/training/losses/multiloss.md index 1dcd8c7..ee5fdcf 100644 --- a/docs/leanai/training/losses/multiloss.md +++ b/docs/leanai/training/losses/multiloss.md @@ -29,7 +29,7 @@ Compute the multiloss using the provided losses. --- -### *def* **MultiLossV2**(parent, **losses) -> SumLoss +### *def* **MultiLossV2**(**losses) -> SumLoss Normalizes the losses by variance estimation and then sums them.