10 std::cout <<
"Vanilla AutoEncoder Training:\n";
11 std::vector<std::vector<double>> ae_training_data = {{1, 0, 0},
14 ae.
train(ae_training_data, 1000);
17 std::cout <<
"\nTesting Vanilla AutoEncoder:\n";
18 std::vector<double> test_input = {1, 1, 0};
19 std::vector<double> output = ae.
forward(test_input);
20 std::cout <<
"Autoencoder Output:\n";
21 for (
double val : output) {
22 std::cout << val <<
" ";
28 std::cout <<
"\n\nSparse AutoEncoder Training:\n";
29 std::vector<std::vector<double>> ae_training_data_sparse = {{1, 0, 0},
32 sparse_ae.
train(ae_training_data_sparse, 1000);
38 std::cout <<
"\nDenoising AutoEncoder Training:\n";
39 denoise_ae.
train(ae_training_data, 1000);
45 std::cout <<
"\nContractive AutoEncoder Training:\n";
46 contractive_ae.
train(ae_training_data, 1000);
52 std::cout <<
"\nRecurrent AutoEncoder Training:\n";
53 std::vector<std::vector<double>> recurrent_ae_training_data = {{1, 0, 0},
56 recurrent_ae.
train(recurrent_ae_training_data, 1000);
A simple implementation of a vanilla autoencoder.
virtual void train(const std::vector< std::vector< double >> &training_data, int epochs)
Train the autoencoder on a dataset.
std::vector< double > forward(const std::vector< double > &input)
Forward pass through the autoencoder.
void display()
Print the weights of the autoencoder.
ContractiveAutoEncoder class, a derived class from AutoEncoder.
virtual void train(const std::vector< std::vector< double >> &training_data, int epochs) override
Trains the contractive autoencoder on the given training data.
DenoisingAutoEncoder class, a derived class from AutoEncoder.
void train(const std::vector< std::vector< double >> &training_data, int epochs) override
Adds noise to the input data and trains the denoising autoencoder.
RecurrentAutoEncoder class, a derived class from AutoEncoder.
virtual void train(const std::vector< std::vector< double >> &training_data, int epochs) override
Trains the recurrent autoencoder on the given sequential data.
SparseAutoEncoder class, a derived class from AutoEncoder.
void train(const std::vector< std::vector< double >> &training_data, int epochs) override
Trains the sparse autoencoder on the given training data.
User API for OpenGPMP MACHINE/DEEP LEARNING MODULE.