GithubHelp home page GithubHelp logo

sentdex / nnfsix Goto Github PK

View Code? Open in Web Editor NEW
1.4K 93.0 365.0 974 KB

Neural Networks from Scratch in various programming languages

Home Page: https://nnfs.io

License: MIT License

Python 2.97% C++ 22.93% JavaScript 2.29% Java 5.82% Rust 3.75% PHP 1.19% GDScript 1.04% PowerShell 1.10% C 14.64% Go 3.17% Lua 4.57% Kotlin 1.08% D 3.77% J 0.42% Assembly 11.41% R 0.48% Swift 9.77% C# 4.93% MATLAB 2.03% Julia 2.66%

nnfsix's Introduction

Neural Networks from Scratch in X

The idea here is to share Neural Networks from Scratch tutorial parts / Neural Networks from Scratch book in various other programming languages, besides just Python.

If you're following along in another language, feel free to contribute to your specific language via a pull request. If you're considering trying to use another language, you can see how others have achieved writing the neural networks from scratch in other languages here too.

How to contribute:

The plan is to share code from video part #s. We will be updating the Python variants, so, if you are just following the book, you can see which block(s) of code should be translated by checking out the Python versions.

Before submitting a PR, check to see if there's already a PR from someone for that specific part # and language.

Submission for given part number should be complete in a single file, ie. should not be split across multiple files. This makes it easier for us to maintain the repository amd easier for others to follow.

If you want to submit solutions in multiple languages, or your submission adds new files and changes files of someone else, create separate PRs for these cases.

We will be accepting PRs in the following ways:

  1. Prioritizing the already-established people who have contributed to that language already.
  2. Prioritizing by who submits first.

nnfsix's People

Contributors

ageekhere avatar aliyss avatar auxintic avatar calebjcourtney avatar casper-smet avatar cdimoy avatar daniel-kukiela avatar delsquared avatar devilbinder avatar harigovind511 avatar hippozhipos avatar jeev20 avatar jesseishi avatar kisanthapa avatar markryanandrews avatar mbdeveci avatar moe-salih avatar mxfxm avatar nicotolly avatar niminem avatar plop9100 avatar rharari avatar robbiemu avatar sentdex avatar shreeviknesh avatar shrig1 avatar slashlogin avatar tjf801 avatar tkozzer avatar ttoros 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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  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  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  avatar  avatar  avatar

nnfsix's Issues

Spiral Data

I am trying to recode your python code to OOREXX.

In your documentation you say "The spiral_data function was slightly modified from https://cs231n.github.io/neural-networkscase-
study/,"

I am not using python so am unable to get your version of the spiral data. Can I download it from someplace?

Thanks

Jupyter Notebook

Can we add jupyter notebook?

Or does it fall under the category of python?

if we can where can we add them under python folder or by making a new folder in the branch.

Question

why is using a Math.matrix instead of a normal array, sorry I'm new to github and I'm not sure if the questions are asked here

Contribution

I see that some part of the java section is yet to be completed is it possible for me to complete it open reading those sections?

Google Colab error: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

Hi there.

Relevant video tutorial - P.5 Hidden Layer Activation Functions

I am using Google Colab in order to follow along.
I am getting "ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()" when trying to run an activation function. See full description bellow.

Any help will be much appreciated, thanks.

Error:

`
/usr/local/lib/python3.6/dist-packages/ipykernel_launcher.py:4: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray
after removing the cwd from sys.path.

ValueError Traceback (most recent call last)
in ()
1 activation_1 = Activation_ReLU()
----> 2 activation_1.forward(layer_1.output)
3 output_2 = activation_1.output

in forward(self, inputs)
2
3 def forward(self, inputs):
----> 4 self.output = np.maximum(0, inputs)

ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
`

My full code is here:

# system update
!apt-get update --fix-missing

!pip install nnfs

import numpy as np
import nnfs
from nnfs.datasets import spiral_data

print(np.__version__)

nnfs.init()

X, y = spiral_data(100, 3)
print(np.shape(X))

`
class Layer_Dense:

def __init__(self, n_inputs: int, n_neurons: int):
    self.output = None
    self.__weights = 0.10 * np.random.randn(n_inputs, n_neurons)
    self.__biases = np.zeros((1, n_neurons))

def forward(self, X):
    self.output = np.dot(X, self.__weights), + self.__biases

`

`
class Activation_ReLU:

def forward(self, inputs):
    self.output = np.maximum(0, inputs)

`

layer_1 = Layer_Dense(np.shape(X)[1], 5)
layer_1.forward(X)
output_1 = layer_1.output

print(output_1)

activation_1 = Activation_ReLU()
activation_1.forward(layer_1.output)
output_2 = activation_1.output

p005- not able to import nnfs

Hi, I ran the debugger to look for the issue and this is what it reports:

Connected to pydev debugger (build 211.7628.24)
Traceback (most recent call last):
File "", line 1027, in _find_and_load
File "", line 1004, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'nnfs'
python-BaseException

nnfs is coming up in the pip list of installed modules, so it seems to be installed.

Any suggestions?

Thank you.

Keep getting 'Layer_Dense' object has no attribute 'weights' with the Lesson 5 python code

Hi,

I tried running the code from lesson 5 in various environments, but I keep getting the following error: 'Layer_Dense' object has no attribute 'weights'

I'm pretty new to Python, but this feels like the init part of the Layer_Dense object isn't initialised. Could somebody please explain what is happening here? I'm eager to learn but don't know where to look (outside of this book + yt series + repo off course)

File "/Documents/PythonProjects/NNFS/lesson5", line 17, in forward
self.output = np.dot(inputs, self.weights) + self.biases
File "/Documents/PythonProjects/NNFS/lesson5", line 26, in
layer1.forward(X)

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.