openGPMP
Open Source Mathematics Package
Functions
mlp.cpp File Reference
#include <deque>
#include <fstream>
#include <iostream>
#include <openGPMP/ml.hpp>

Go to the source code of this file.

Functions

int main ()
 

Function Documentation

◆ main()

int main ( void  )
Examples
mlp.cpp.

Definition at line 17 of file mlp.cpp.

17  {
18  std::cout << "SAMPLE USING THE MULTI-LAYER PERCEPTRON NETWORK.\n";
19 
20  std::srand(42069);
21  // initialize the SecondaryMLP model
22  int64_t inputs{1}, outputs{1}, hidden_layer_units{8}, hidden_layers{3};
23 
24  long double lr{.5};
25  gpmp::ml::Trainers util;
26  auto model = util.init_SecondaryMLP(inputs = 1,
27  outputs = 1,
28  hidden_layer_units = 8,
29  hidden_layers = 3,
30  lr = .5);
31 
32  // declare a data file
33 
34  // TODO : create util method to save/read/parse datafile, and
35  // columns
36  // std::ofstream data_file;
37  std::string data_file = "../../data/school_scores.csv";
38 
39  uint64_t max_iters{1000}, return_every{500};
40  // call the train method for the SecondaryMLP model
41  util.train_SecondaryMLP(model, data_file, max_iters, return_every);
42 
43  return 0;
44 }
Training Algorithms.
Definition: trainers.hpp:54