Autoencoder¶
LitAutoEncoder
¶
Bases: LightningModule
A simple autoencoder model.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
encoder
|
Sequential
|
The encoder component, responsible for encoding input data. |
required |
decoder
|
Sequential
|
The decoder component, responsible for decoding encoded data. |
required |
Source code in packages/lit-auto-encoder/src/lit_auto_encoder/auto_encoder.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
|
configure_optimizers()
¶
Configure the Adam optimizer.
Source code in packages/lit-auto-encoder/src/lit_auto_encoder/auto_encoder.py
42 43 44 45 |
|
training_step(batch, batch_idx)
¶
Performs a single training step for the model.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
batch
|
Tuple[Tensor, Tensor]
|
A tuple containing the input data (x) and the corresponding labels (y). |
required |
batch_idx
|
int
|
The index of the current batch. |
required |
Returns:
Name | Type | Description |
---|---|---|
Tensor |
Tensor
|
The computed loss for the current training step. |
Source code in packages/lit-auto-encoder/src/lit_auto_encoder/auto_encoder.py
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
|