ERIS CORE

◆ render()

void AppAIfES::render ( )
inlineoverrideprotectedvirtual

render loop

Reimplemented from AppBaseClass.

Definition at line 118 of file AppAIfES.h.

118  {
119  //perform the training
120  uint16_t x_train_shape[2] = {3, 3};
121  float x_train_data[3*3] = {0.0f, 0.0f, 0.0f,
122  1.0f, 1.0f, 1.0f,
123  1.0f, 0.0f, 0.0f};
124  x_train = AITENSOR_2D_F32(x_train_shape, x_train_data);
125 
126  // Target data / Labels for training
127  uint16_t y_train_shape[2] = {3, 2};
128  float y_train_data[3*2] = {1.0f, 0.0f,
129  0.0f, 1.0f,
130  0.0f, 0.0f};
131  y_train = AITENSOR_2D_F32(y_train_shape, y_train_data);
132 
133  x_test = &x_train;
134  y_test = &y_train;
135 
136 
137  // One epoch of training. Iterates through the whole data once
138  float loss;
139  int batch_size = 300;
140 
141  aialgo_train_model(&model, &x_train, &y_train, optimizer, batch_size);
142  aialgo_calc_loss_model_f32(&model, x_test, y_test, &loss);
143 
144  // Print the loss to the console
145  //aiprint("M VM Epoch "); aiprint_int("%5d", 0);
146  //aiprint(": test loss: "); aiprint_float("%f", loss);
147  //aiprint("\n");
148  }; //called only when the app is active
aitensor_t x_train
Definition: AppAIfES.h:113
aitensor_t y_train
Definition: AppAIfES.h:114
aiopti_t * optimizer
Definition: AppAIfES.h:111
aimodel_t model
Definition: AppAIfES.h:101
aitensor_t * x_test
Definition: AppAIfES.h:115
aitensor_t * y_test
Definition: AppAIfES.h:116

References model, optimizer, x_test, x_train, y_test, and y_train.