feat: use DeepNNLayer in Autoencoder

This commit is contained in:
Lenoctambule
2026-03-28 02:07:23 +01:00
parent a50a09b337
commit e5520bf050
2 changed files with 28 additions and 18 deletions

View File

@@ -26,8 +26,17 @@ def mnist_test(
x_train = np.divide(x_train, 255)
x_test = np.divide(x_train, 255)
in_len = x_train[0].shape[0] * x_train[0].shape[0]
autoencoder = Autoencoder(in_len, bottleneck, 0.001, relu)
autoencoder.train_dataset(x_train, max_epoch, patience, display_loss=True)
autoencoder = Autoencoder(
[in_len, bottleneck],
[bottleneck, in_len],
0.1,
relu
)
autoencoder.train_dataset(
x_train,
max_epoch,
patience,
display_loss=True)
example: np.ndarray = x_test[np.random.randint(0, len(x_test))]
code = autoencoder.encode(example.flatten())
output = autoencoder.decode(code)