{"id":29625128,"url":"https://github.com/theolepage/prophecy","last_synced_at":"2025-10-06T16:03:46.941Z","repository":{"id":54433893,"uuid":"248822960","full_name":"theolepage/prophecy","owner":"theolepage","description":"A tiny deep neural network framework developed from scratch in C++ and CUDA.","archived":false,"fork":false,"pushed_at":"2021-02-18T10:07:48.000Z","size":144,"stargazers_count":11,"open_issues_count":10,"forks_count":2,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-07-21T06:12:20.233Z","etag":null,"topics":["cpp","cpp17","machine-learning","machine-learning-framework","machine-learning-from-scratch","ml-framework","neural-network"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/theolepage.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-03-20T18:14:23.000Z","updated_at":"2025-07-17T08:57:28.000Z","dependencies_parsed_at":"2022-08-13T15:31:11.743Z","dependency_job_id":null,"html_url":"https://github.com/theolepage/prophecy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/theolepage/prophecy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theolepage%2Fprophecy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theolepage%2Fprophecy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theolepage%2Fprophecy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theolepage%2Fprophecy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/theolepage","download_url":"https://codeload.github.com/theolepage/prophecy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theolepage%2Fprophecy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272867554,"owners_count":25006631,"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","status":"online","status_checked_at":"2025-08-30T02:00:09.474Z","response_time":77,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["cpp","cpp17","machine-learning","machine-learning-framework","machine-learning-from-scratch","ml-framework","neural-network"],"created_at":"2025-07-21T06:07:22.609Z","updated_at":"2025-10-06T16:03:46.873Z","avatar_url":"https://github.com/theolepage.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# prophecy\n\nCheck this out Google.\n\n## Usage\n\n```cpp\n#include \u003ciostream\u003e\n#include \u003cmemory\u003e\n\n#include \"model/model.hh\"\n#include \"layer_implem/dense_layer.hh\"\n\nusing model_type = float;\nusing training_set = std::vector\u003cMatrix\u003cmodel_type\u003e\u003e;\n\nstatic auto get_xor(unsigned a, unsigned b)\n{\n    auto mx = Matrix\u003cmodel_type\u003e(2, 1);\n    mx(0, 0) = a;\n    mx(1, 0) = b;\n\n    auto my = Matrix\u003cmodel_type\u003e(1, 1);\n    my(0, 0) = a^b;\n\n    return std::make_pair(mx, my);\n}\n\nstatic void create_dataset(\n        training_set\u0026 x_train,\n        training_set\u0026 y_train)\n{\n    auto a = get_xor(0, 0);\n    x_train.emplace_back(a.first);\n    y_train.emplace_back(a.second);\n\n    auto b = get_xor(0, 1);\n    x_train.emplace_back(b.first);\n    y_train.emplace_back(b.second);\n\n    auto c = get_xor(1, 0);\n    x_train.emplace_back(c.first);\n    y_train.emplace_back(c.second);\n\n    auto d = get_xor(1, 1);\n    x_train.emplace_back(d.first);\n    y_train.emplace_back(d.second);\n}\n\nint main(void)\n{\n    Model\u003cmodel_type\u003e model = Model\u003cmodel_type\u003e();\n    SigmoidActivationFunction s = SigmoidActivationFunction\u003cmodel_type\u003e();\n\n    // Create model\n    model.add(new InputLayer\u003cmodel_type\u003e(2));\n    model.add(new DenseLayer\u003cmodel_type\u003e(2, s));\n    model.add(new DenseLayer\u003cmodel_type\u003e(1, s));\n\n    // Create dataset\n    auto x_train = training_set();\n    auto y_train = training_set();\n    create_dataset(x_train, y_train);\n\n    // Train model\n    model.compile(0.1);\n    model.train(x_train, y_train, 10000, 1);\n\n    // Test the model\n    for (size_t i = 0; i \u003c x_train.size(); i++)\n    {\n        auto x = x_train.at(i);\n        auto x_t = x.transpose();\n        auto y = model.predict(x);\n        std::cout \u003c\u003c \"Input:  \" \u003c\u003c x_t;\n        std::cout \u003c\u003c \"Output: \" \u003c\u003c y \u003c\u003c std::endl;\n    }\n\n    return 0;\n}\n```\n\n## To-Do\n\nRefer to [this page](https://github.com/theolepage/prophecy/projects/1).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheolepage%2Fprophecy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftheolepage%2Fprophecy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheolepage%2Fprophecy/lists"}