Readability tweaks
This commit is contained in:
parent
c2b9dfdd29
commit
4169714b24
1 changed files with 8 additions and 5 deletions
13
src/neural.c
13
src/neural.c
|
@ -44,8 +44,8 @@ neural_new(size_t input_size, size_t output_size, size_t layer_count) {
|
|||
|
||||
// Calculate sizes of individual layers and allocate them.
|
||||
for (int i = 0; i < layer_count; i++) {
|
||||
self->layers[i] = nl_new(input_size
|
||||
+ (layer_diff * i / ((ssize_t)layer_count-1)),
|
||||
self->layers[i] = nl_new(input_size + (layer_diff * i
|
||||
/ ((ssize_t)layer_count-1)),
|
||||
|
||||
i < (layer_count-1) ?
|
||||
(input_size + (layer_diff * (i+1)
|
||||
|
@ -243,16 +243,19 @@ neural_getMesh(Neural_Network *nn, ModelRegistry *mr) {
|
|||
}
|
||||
|
||||
model = model_circle(0, (GLfloat)1/64);
|
||||
brightness = nl->neurons[i].value <= 1.0 ? nl->neurons[i].value : 255;
|
||||
brightness = nl->neurons[i].value <= 1.0 ?
|
||||
nl->neurons[i].value : 255;
|
||||
model_colorXYZ(model, 0, brightness, 0);
|
||||
Tensor *translation_matrix = tensor_new(4, 4);
|
||||
Tensor *aspectRatio_matrix = tensor_new(4, 4);
|
||||
aspectRatio_matrix->data[0] = (GLfloat)9/16;
|
||||
|
||||
translation_matrix->data[3] = (((GLfloat)-1*16/9)*.90)
|
||||
+ ((GLfloat)1/(nl->layer_size-1)*2 * i * (((GLfloat)16/9))*.90);
|
||||
+ ((GLfloat)1/(nl->layer_size-1)
|
||||
* 2 * i * (((GLfloat)16/9))*.90);
|
||||
|
||||
translation_matrix->data[7] = .90 - ((GLfloat)1/(nn->layer_count)*2 * j *.90);
|
||||
translation_matrix->data[7] = .90 - ((GLfloat)1/(nn->layer_count)
|
||||
* 2 * j *.90);
|
||||
|
||||
model->transformations[0] = translation_matrix;
|
||||
model->transformations[1] = aspectRatio_matrix;
|
||||
|
|
Loading…
Reference in a new issue