{"id":21321115,"url":"https://github.com/perdumonocle/neuralnet2cpp","last_synced_at":"2026-05-13T07:40:50.674Z","repository":{"id":137985427,"uuid":"94133460","full_name":"perdumonocle/neuralnet2cpp","owner":"perdumonocle","description":"Compute your R 'neuralnet' neural network using cpp code","archived":false,"fork":false,"pushed_at":"2017-06-13T06:39:50.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-22T11:47:05.705Z","etag":null,"topics":["c","code-generation","code-generator","codegen","codegenerator","compute","converter","cpp","neural-network","neuralnet","r"],"latest_commit_sha":null,"homepage":null,"language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/perdumonocle.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-06-12T19:37:03.000Z","updated_at":"2017-06-13T02:26:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"b5c86f87-ca61-44f6-8c18-0c9c456965ba","html_url":"https://github.com/perdumonocle/neuralnet2cpp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perdumonocle%2Fneuralnet2cpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perdumonocle%2Fneuralnet2cpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perdumonocle%2Fneuralnet2cpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perdumonocle%2Fneuralnet2cpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/perdumonocle","download_url":"https://codeload.github.com/perdumonocle/neuralnet2cpp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243801609,"owners_count":20350106,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c","code-generation","code-generator","codegen","codegenerator","compute","converter","cpp","neural-network","neuralnet","r"],"created_at":"2024-11-21T19:56:37.464Z","updated_at":"2026-05-13T07:40:45.628Z","avatar_url":"https://github.com/perdumonocle.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"# neuralnet2cpp\n\u003cstrong\u003eCompute your R 'neuralnet' neural network using cpp code.\u003c/strong\u003e\n\nYou can train you neural network with R:\n\u003cpre\u003e\n\u0026gt; library( 'neuralnet' )\n\u0026gt; data \u0026lt;- data.frame( i1 = c(1, 2, 4), i2 = c(5, 5, 6), o = c(1, 1, 0) )\n\u0026gt; net \u0026lt;- neuralnet( o~i1+i2, hidden = c( 5, 2 ) )\n\u003c/pre\u003e\n\nThen test your net:\n\u003cpre\u003e\n\u0026gt; test \u0026lt;- data.frame( i1 = 5, i2 = 1 )\n\u0026gt; res \u0026lt;- compute( net, test )\n\u0026gt; res$net.result\n               [,1]\n[1,] -0.08056605515\n\u003c/pre\u003e\n\nAnd convert that network into cpp:\n\u003cpre\u003e\n\u003e compute.gen.cpp( net, \"~/myprojects/subfolder/compute.cpp\" )\n\u003c/pre\u003e\n\nTest your network using compute.cpp:\n\u003cpre\u003e\nint main(int argc, char *argv[])\n{\n    const double covariates[2] = { 5, 1 };\n    double results[1] = { 0 };\n    neuralnet::compute( \u0026amp;covariates[0], \u0026amp;results[0] );\n    printf( \"%f\\n\", results[0] ); // -0.080566\n    return 0;\n}\n\u003c/pre\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fperdumonocle%2Fneuralnet2cpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fperdumonocle%2Fneuralnet2cpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fperdumonocle%2Fneuralnet2cpp/lists"}