News for hackers. Stuff that matters.
Re:How to build your own neural network from scratch in Python by a_bonobo on Friday October 05, 2018 @12:23AM (#18145744)
Too often you see articles like this and they start with

$ import a_whole_bunch_of_stuff

Good to see that this is not the case here :)

The fast.ai course has a similar exercise in the beginning, but you'll still import the weights from somewhere else.

Their fast.ai v1 library has a very short implementation too (loading the MINIST example dataset and then using Resnet18):

    from fastai import *  
    from fastai.data import *  
    untar_data(MNIST_PATH)  
    data = image_data_from_folder(MNIST_PATH)  
    learn = ConvLearner(data, tvm.resnet18, metrics=accuracy)  
    learn.fit(1)
Done!

Source: http://docs.fast.ai/

Re:How to build your own neural network from scratch in Python by sprobertson on Friday October 05, 2018 @01:33AM (#18145939)
How is your example not "$ import a_whole_bunch_of_stuff"?
Re:How to build your own neural network from scratch in Python by ScoutOrgo on Friday October 05, 2018 @12:23PM (#18149388)
This notebook from fast.ai is more in line with what op mentioned. It starts from nothing but Python and slowly swaps out chunks of code with functions/classes from Torch/fastai:

https://github.com/fastai/fastai/tree/master/courses/dl1

Re:How to build your own neural network from scratch in Python by a_bonobo on Friday October 05, 2018 @02:21AM (#18146069)
should've been more explicit - deleted that part accidentally in an early edit, but yeah, that's what I would've expected, an 'import from' at the beginning
Re:How to build your own neural network from scratch in Python by MrUnderBridje on Friday October 05, 2018 @01:24PM (#18149946)
You always have to start somewhere.
Re:How to build your own neural network from scratch in Python by partycoder on Friday October 05, 2018 @01:18AM (#18145893)
How to make cake, by Russell Peters

First, you get cake. Then you make it for 20 minutes. Then you have cake.

Re:How to build your own neural network from scratch in Python by amelius on Friday October 05, 2018 @04:59AM (#18146696)
Step 1. Write function that evaluates cake. Step 2. Use genetic algorithm to bake perfect cake.
Re:How to build your own neural network from scratch in Python by zodPod on Thursday October 11, 2018 @02:59PM (#18196125)
There's a guy who makes youtube videos like this a lot. He's a good guy and a smart guy but seems to either not care or not realize he isn't helping. I've seen videos like "Computer Vision In 5 lines" where the first line is "import helperclass.py" or something like that and that helper class has like 1500 lines of code that he wrote to implement. Sure people need to be aware of what they're learning but if someone has no programming experience and finds that video they're going to just think it's magic.
Re:How to build your own neural network from scratch in Python by ShorsHammer on Friday October 05, 2018 @01:39AM (#18145955)
It's not mentioned in the article but he is importing numpy.

It has around 100k LOC.

Re:How to build your own neural network from scratch in Python by halflings on Friday October 05, 2018 @02:30AM (#18146112)
numpy is considered a low-level backbone of data science on Python; re-writing it would be equivalent to re-writing the "print" function.

OP is probably referring to somebody importing a high-level class that does something complex (auto-differentiation etc.)

Re:How to build your own neural network from scratch in Python by MrUnderBridje on Friday October 05, 2018 @04:41AM (#18146645)
You always have to start somewhere. Do you want to code all the OS from the ground up, or do you have minimal expectations about the environment your software will run on? Do you want to look at all the tiny details, or do you wish to focus on a specific aspect of the problem? The article author could also give an explanation of linear algebra, but I guess he expects the reader to be familiar with this part of the problem.

I guess that there's always a software layer which may be considered "backbone". For people designing networks, all the tedious work of building the network is just plumbing, and they probably expect it to be automated from a formal description of the network.

Re:How to build your own neural network from scratch in Python by FartyMcFarter on Friday October 05, 2018 @07:36AM (#18147278)
> I guess that there's always a software layer which may be considered "backbone".

The point is that you don't need any software layers at all to code up a basic neural network implementation. A programming language with basic floating-point operations is all you need. The algorithms are not complicated so even x86 Assembly is practical for this purpose if you're already experienced with it. So the "backbone" can simply be your favorite compiler.

> Do you want to code all the OS from the ground up

If it's a "make your OS" course then yes - a simple OS of course. If you want to become experienced in compilers, then writing a compiler from scratch for a simple language is mandatory for people who want to have solid fundamentals. It's not a coincidence that projects like these are common in Computer Science and Software Engineering courses.

Re:How to build your own neural network from scratch in Python by MrUnderBridje on Friday October 05, 2018 @01:08PM (#18149816)
> The point is that you don't need any software layers at all to code up a basic neural network implementation.

I grafted my answer to the wrong post, I meant to respond to the guy talking about the project implicitely using Numpy.

Offtopic remark: It would be nice to be able to move a post to a different thread, or make a single answer to several messages.

Re:How to build your own neural network from scratch in Python by mos_basik on Friday October 05, 2018 @01:43PM (#18150105)
>single answer to several messages

Always surprises me that out of all the different kinds of internet communities, it's only the oft-maligned imageboards that consistently provide that feature.

I was kind of expecting Discourse to play with the idea, since they seem to be the modern-reboot-of-forums with the most traction + willingness to experiment, but they haven't so far, afaik.

Re:How to build your own neural network from scratch in Python by spicytunacone on Friday October 05, 2018 @05:16PM (#18151806)
How would you represent that? On HN and similar every response is its own thread. This is true with email as well, but I don't have experience with any significant threads or mailing lists.

The naïve solution would be to just limit nesting and order nested comments chronologically. Another solution may be to CC @postid in your messages and have posts display "responding to: id1, id4" at the top and "responses: id91" at the bottom with appropriate links. There's a question here about which post to write or display your response under. Finally, an extravagant solution would be to really represent discussion as a graph and I think a lot of time would need to be spent creating an interface with minimal frustration as I feel it can get really involved (i.e., a lot of clicking).

Curious what you or anyone else thinks.