From 4169714b24552a0d2760bca70ee74ab2be9efc85 Mon Sep 17 00:00:00 2001 From: Marcel Plch Date: Mon, 11 Nov 2024 18:43:38 +0100 Subject: [PATCH] Readability tweaks --- src/neural.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/neural.c b/src/neural.c index de35c05..5c40676 100644 --- a/src/neural.c +++ b/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;