Skip to content

Utilize in place algorithms to minimise memory freeing and new memory allocating #30

@willayy

Description

@willayy

Primarily thinking about these lines in the training algorithm:

double * partialGradients = (double *) malloc(sizeof(double) * nn->nrOfNeurons);
for (int i = 0; i < nn->nrOfNeurons; i++) { partialGradients[i] = 0;}
GradientVector * gv = (GradientVector *) malloc(sizeof(GradientVector));
initGradientVector(gv, nn->nrOfNeurons);

GradientVector * gv = (GradientVector *) malloc(sizeof(GradientVector));
initGradientVector(gv, gb->gradientVectors[0]->nrOfNeurons);

NeuronGradient * ng = (NeuronGradient *) malloc(sizeof(NeuronGradient));
initGradient(ng, gb->gradientVectors[i]->gradients[j]->nrOfWeights);

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions