{"id":17250684,"url":"https://github.com/statusfailed/numeric-optics-python","last_synced_at":"2025-07-23T11:05:11.652Z","repository":{"id":60968487,"uuid":"329273801","full_name":"statusfailed/numeric-optics-python","owner":"statusfailed","description":null,"archived":false,"fork":false,"pushed_at":"2022-05-19T10:18:25.000Z","size":48,"stargazers_count":25,"open_issues_count":0,"forks_count":3,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-14T05:17:44.331Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/statusfailed.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":"2021-01-13T10:35:50.000Z","updated_at":"2025-02-21T02:02:13.000Z","dependencies_parsed_at":"2022-10-07T15:23:03.136Z","dependency_job_id":null,"html_url":"https://github.com/statusfailed/numeric-optics-python","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/statusfailed/numeric-optics-python","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/statusfailed%2Fnumeric-optics-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/statusfailed%2Fnumeric-optics-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/statusfailed%2Fnumeric-optics-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/statusfailed%2Fnumeric-optics-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/statusfailed","download_url":"https://codeload.github.com/statusfailed/numeric-optics-python/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/statusfailed%2Fnumeric-optics-python/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266665800,"owners_count":23964973,"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-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"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":[],"created_at":"2024-10-15T06:49:19.766Z","updated_at":"2025-07-23T11:05:11.634Z","avatar_url":"https://github.com/statusfailed.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Numeric Optics\n\nA python library for constructing and training neural networks based on lenses\nand reverse derivatives.\n\nTested with Python 3.9\n\n# Experiments / Usage Examples\n\nExamples of model construction and training can be found in the\n[./experiments](./experiments) directory.\nTo run them, you will need to install some additional dependencies:\n\n    pip install -r experiments-requirements.txt\n\nYou can now run the following examples:\n\n- [Iris dataset](http://archive.ics.uci.edu/ml/datasets/Iris/)\n  - A single dense layer model: `python -m experiments.iris simple`\n  - A neural network with a 20-node hidden layer: `python -m experiments.iris hidden`\n- [MNIST dataset](http://yann.lecun.com/exdb/mnist/)\n  - A convolutional model `python -m experiments.convolutional`\n\n## Data\n\nTo download the `iris` dataset, run\n\n    ./get-iris-dataset.sh\n\nTo download the `mnist` dataset, run\n\n    ./get-mnist-dataset.sh\n\n## Equivalent Keras Experiments\n\nFor each experiment, we provide an equivalent written in [keras][keras].\n\n[keras]: https://keras.io/\n\nTo run them, install keras and tensorflow dependencies:\n\n    pip install -r keras-experiments-requirements.txt\n\nAnd you can run each experiment as follows:\n\n    # Single dense layer Iris model\n    python -m keras_experiments.iris simple\n\n    # 20-hidden-node neural network Iris model\n    python -m keras_experiments.iris hidden\n\n    # MNIST convolutional model\n    python -m keras_experiments.convolutional\n\n# Constructing a model\n\nModels are built using composition `\u003e\u003e` and tensoring `@` of basic primitives.\nFor example, one can construct a neural network's dense layer as the composition of three `ParaInit` lenses:\n\n    linear \u003e\u003e bias \u003e\u003e activation\n\nWhich is depicted diagrammatically as the Para map:\n\n               M                B\n               ↓        B       ↓\n    A --- [  linear ] ----- [ bias ] --- [ activation ] ----\n\nwhere:\n\n- `M` is a matrix (the weights)\n- `B` is a vector (the biases)\n- `A` is a vector (the input to the network)\n\nNote that as a \"normal\" string diagram, this is written as follows:\n\n    B -----------------\\\n                        \\\n    M ---\\               [ + ] --- [ activation ] ---- B\n          [ linear ] ---/\n    A ---/\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstatusfailed%2Fnumeric-optics-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstatusfailed%2Fnumeric-optics-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstatusfailed%2Fnumeric-optics-python/lists"}