docs(README.md): update Autoencoder class usage

This commit is contained in:
Lenoctambule
2026-03-29 19:25:42 +02:00
parent 53c7f73055
commit 8a3d408b7a

View File

@@ -17,8 +17,14 @@ $ py mnist_test.py
Instatiate an `Autoencoder` object : Instatiate an `Autoencoder` object :
```py ```py
from autoencoder import Autoencoder from autoencoder import Autoencoder
from activations import LeakyReLU
autoencoder = Autoencoder(in_len=300, bottleneck=50, 0.001, relu) autoencoder = Autoencoder(
[768, 64, 16],
[16, 64, 768],
0.01,
LeakyReLU()
)
``` ```
And then via the `train_dataset` method to train over a dataset : And then via the `train_dataset` method to train over a dataset :
```py ```py
@@ -31,9 +37,10 @@ autoencoder.train(v)
## Inference ## Inference
Use your `Autoencoder` object with the `encode` and `decode` methods like so : Use your `Autoencoder` object with the `encode`, `decode`, `forward` methods like so :
```py ```py
example = ... example = ...
code = autoencoder.encode(example) code = autoencoder.encode(example)
output = autoencoder.decode(code) output = autoencoder.decode(code)
output, code = autoencoder.forward(example)
``` ```