Code Monkey home page Code Monkey logo

vivianoriccardo / learning-lab-c-library Goto Github PK

View Code? Open in Web Editor NEW
31.0 6.0 8.0 7.46 MB

This library provides a set of basic functions for different type of deep learning (and other) algorithms in C.This deep learning library will be constantly updated

License: MIT License

Makefile 0.06% C 99.93% Shell 0.01%
deeplearning neural-network c library backpropagation softmax convolutional-layers residual-networks residual-layers nesterov

learning-lab-c-library's People

Contributors

vivianoriccardo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

learning-lab-c-library's Issues

Out-of-date examples

This library is by far the most comprehensive deep learning framework in C, and is strangely underrated.

One possible reason is that the examples have not been updated for the new versions, and thus, newcomers cannot appreciate the performance of this library.

function itoa has been changed to itoa_n.

function fully_connected needs mode as the 11th argument.

tests for fully_connected function

I was trying to run some of the tests like test1 through test6 and I'm noticing that fully_connected needs two extra parameters.
So I tried putting in for example 8, NO_NORMALIZATION as the last two parameters, however I don't know if that is supposed to work.
I'm able to compile however there is an Illegal instruction (core dumped) on my Ubuntu platform.
Specifically with a debugger it is showing that c->layer = layer in convolutional_layers.c is a problem.

Memory leak?

I found out that during model training RAM usage increase continuously.
Deep dive into sources show that in function model_tensor_input_ff memory is allocated first for post_activation and next post_activation is assigned the input, which is passed to function. But the allocated memory is not freed. Here the example from model.c:

void model_tensor_input_ff(model* m, int tensor_depth, int tensor_i, int tensor_j, float* input){
    if(m == NULL)
        return;
    int i,j,z,w,count,count2,z2,k1 = 0, k2 = 0, k3 = 0;
    /* Setting the input inside a convolutional structure*/
    cl* temp = (cl*)malloc(sizeof(cl));
    temp->post_activation = (float*)malloc(sizeof(float)*tensor_depth*tensor_i*tensor_j);
    temp->normalization_flag = NO_NORMALIZATION;
    temp->pooling_flag = NO_POOLING;
    temp->activation_flag = SIGMOID;
    temp->n_kernels = tensor_depth;
    temp->rows1 = tensor_i;
    temp->cols1 = tensor_j;
    temp->post_activation = input;
    temp->layer = -1;

Deleting the line:
temp->post_activation = (float*)malloc(sizeof(float)*tensor_depth*tensor_i*tensor_j);
solves the problem.

But maybe it causes some side effects?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.