{"id":19659999,"url":"https://github.com/samyak2/neural-network-julia","last_synced_at":"2026-06-06T21:32:14.082Z","repository":{"id":117920364,"uuid":"231930773","full_name":"Samyak2/Neural-Network-Julia","owner":"Samyak2","description":"A neural network implementation in Julia","archived":false,"fork":false,"pushed_at":"2020-12-10T09:52:00.000Z","size":15027,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-10T01:28:39.532Z","etag":null,"topics":["gpu","julia","neural-network"],"latest_commit_sha":null,"homepage":"","language":"Julia","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/Samyak2.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":"2020-01-05T14:38:03.000Z","updated_at":"2023-03-16T05:55:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"35af3002-2975-4d8a-b082-a5907c98a2ec","html_url":"https://github.com/Samyak2/Neural-Network-Julia","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/Samyak2%2FNeural-Network-Julia","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Samyak2%2FNeural-Network-Julia/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Samyak2%2FNeural-Network-Julia/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Samyak2%2FNeural-Network-Julia/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Samyak2","download_url":"https://codeload.github.com/Samyak2/Neural-Network-Julia/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240968949,"owners_count":19886398,"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":["gpu","julia","neural-network"],"created_at":"2024-11-11T15:44:56.228Z","updated_at":"2025-11-20T22:04:50.344Z","avatar_url":"https://github.com/Samyak2.png","language":"Julia","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Neural-Network-Julia\n\nA neural network implementation in Julia\n\n# Features\n\n - Construct a neural network with any number of layers\n - Only binary classification (for now)\n - Support for training on GPU\n\n# Requirements\n\n - Julia 1.3\n - TimerOutputs\n - IJulia (for jupyter notebooks given in the `Examples` directory)\n \nFor GPU support, the following are required (make sure that their tests are passing):\n - CuArrays (tested with v1.7.3)\n - CUDAnative (tested with v2.10.2)\n - CUDAdrv (optional, tested with v6.0.0)\n\n# Usage\n\nCheck out the [examples](./Examples) for complete end-to-end training and testing examples.\n\n1. As of now, this has not been made into a Julia package. So you will have to include the `NeuralNetwork.jl` file to use it (also, there will be some JIT overhead during the first use). Download the files in this repo and import the functions by using (make sure to use the complete relative or absolute instead of just `\"NeuralNetwork.jl\"`):\n    ```julia\n    include(\"NeuralNetwork.jl\")\n    ```\n\n2. Load your training and testing data in the form of `Float32` arrays (the outputs Y can be `Int` also).\n\n3. Use the `neural_network_dense` function to train the Neural Network. See the help section for more info - `?neural_network_dense` should provide the docs. Here is an example usage:\n    ```julia\n    parameters, activations = neural_network_dense(train_X, train_Y, [12288, 10, 1], 1000, 0.001)\n    ```\n    \n    `[12288, 10, 1]` is the number of neurons in each layer, `1000` is the number of steps to train for and `0.001` is the learning rate.\n\n4. Get predictions and accuracy using the `predict` function. Again, check out the help page for more details - `?predict`. Example usage:\n    ```julia\n    predicts, accuracy = predict(test_X, test_Y, parameters, activations)\n    ```\n5. (Optional) To see the time taken for each step in the Neural Network, use\n    ```julia\n    print_timer(to)\n    ```\n\n## GPU Training:\n\n - `include(\"NeuralNetworkGPU.jl\")`\n - Import the necessary packages - `using CuArrays, CUDAnative, CUDAdrv`\n - Convert the training data to `CuArray`s:\n\n    ```julia\n    train_X = CuArray(train_X)\n    train_Y = CuArray(train_Y)\n    ```\n - Use the same `neural_network_dense` and `predict` functions\n - That's it! (All the optmization for GPU is internal, take a look at [NeuralNetworkGPU.jl](NeuralNetworkGPU.jl))\n\n# TODO\n\n - [ ] Multi-class classification\n - [ ] Custom GPU kernels for activation functions on GPU\n\n# Acknowledgements\n\n - [Deeplearning.ai](https://www.deeplearning.ai/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamyak2%2Fneural-network-julia","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamyak2%2Fneural-network-julia","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamyak2%2Fneural-network-julia/lists"}