-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcurrent_test.cpp
34 lines (33 loc) · 909 Bytes
/
current_test.cpp
1
2
3
4
5
6
7
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
#include "micrograd.hpp"
#include "value.hpp"
#include "mlp.hpp"
using namespace microgradCpp;
/*
--file_name ./data/iris.csv
--encode variety
*/
int main(int argc, char *argv[])
{
// DatasetType dataset = get_iris();
DataFrame df;
df.from_csv("./data/wine.csv", true, ';');
// df.normalize( );
df.encode_column("quality");
df.print();
df.shuffle();
df.print();
double TRAIN_SIZE{0.8};
// Create MLP model
// Input: 4 features, hidden layers: [7,7], output: 3 classes
// Define the model and hyperparameters
// MLP model(4, {10, 10, 3});
MLP model(4, {16, 16, 10});
auto params = model.parameters();
double learning_rate = 0.01;
int epochs; // = 100;
std::cout << "Epoch : ?";
std::cin >> epochs;
AdamOptimizer optimizer(params, learning_rate);
train_eval(df, TRAIN_SIZE, model, optimizer, epochs);
return 0;
}