Discuss Scratch

80sFanKid
Scratcher
44 posts

How would one make a neural network?

i understand that it needs alot of algebra, but how would you make it solve a problem? ex. learn to play a game
cheers, 80


“No problem can be solved from the same level of consciousness that created it.”
Albert Einstein
80sFanKid
Scratcher
44 posts

How would one make a neural network?

Update: code so far is like this:
define cluster (amount of neurons)
clear
pen up
repeat (amount of neurons)
create clone of [ self v]
pen down
go to x: (pick random (10) to (100))y: (pick random (10) to (100))
pen up

end
this is to wire the neurons.
see video: https://www.youtube.com/watch?v=R9OHn5ZF4Uo

Last edited by 80sFanKid (Feb. 16, 2019 18:22:09)



“No problem can be solved from the same level of consciousness that created it.”
Albert Einstein
imfh
Scratcher
1000+ posts

How would one make a neural network?

This article may help you understand some of the mathematics behind neural networking:
http://neuralnetworksanddeeplearning.com/chap1.html

The code you made might be start to drawing a neural network, but it's not what you want to calculating one.

Scratch to Pygame converter: https://scratch.mit.edu/discuss/topic/600562/
80sFanKid
Scratcher
44 posts

How would one make a neural network?

i guess i should start with a neuron. what should i make it do, and how would i do it?


“No problem can be solved from the same level of consciousness that created it.”
Albert Einstein
80sFanKid
Scratcher
44 posts

How would one make a neural network?

80sFanKid wrote:

i guess i should start with a neuron. what should i make it do, and how would i do it?

imfh wrote:

This article may help you understand some of the mathematics behind neural networking:
http://neuralnetworksanddeeplearning.com/chap1.html

The code you made might be start to drawing a neural network, but it's not what you want to calculating one.


“No problem can be solved from the same level of consciousness that created it.”
Albert Einstein
Anonymous1212144
Scratcher
100+ posts

How would one make a neural network?

The basic idea of a neural network is it does something incorrectly, then adjust the weights depending on the error so it is more accurate the next time it does it.
80sFanKid
Scratcher
44 posts

How would one make a neural network?

that is what i want to do.
but my question, HOW would i do it?


“No problem can be solved from the same level of consciousness that created it.”
Albert Einstein
Anonymous1212144
Scratcher
100+ posts

How would one make a neural network?

This is a general outline of one of the ways to build a neural network:

Let the inputs be i, the transformed input be t, the correct outputs be c, the neural network's outputs be o, and the weights be w.
Note: c, o, and w are 1d lists. i and t are 2d lists.

1. Get i and c.
2. Set w to random numbers.
3. Set o to this: 1 / (1 +e^(- iw))
4. Adjust w by this amount: (t)(c-o)(o)(1-o)

These instructions are kind of vague, so ask me if you have any questions.
80sFanKid
Scratcher
44 posts

How would one make a neural network?

Thanks! i'll try to build some simple brain with this.


“No problem can be solved from the same level of consciousness that created it.”
Albert Einstein
80sFanKid
Scratcher
44 posts

How would one make a neural network?


Anonymous1212144 wrote:

This is a general outline of one of the ways to build a neural network:

Let the inputs be i, the transformed input be t, the correct outputs be c, the neural network's outputs be o, and the weights be w.
Note: c, o, and w are 1d lists. i and t are 2d lists.

1. Get i and c.
2. Set w to random numbers.
3. Set o to this: 1 / (1 +e^(- iw))
4. Adjust w by this amount: (t)(c-o)(o)(1-o)

These instructions are kind of vague, so ask me if you have any questions.

how would you add inputs, or does it do this unnoticed and automatically?
edit: another question, and sorry if i am acting stupid, what is iw?
another edit: got it, just found out.
what does it do, exactly?

Last edited by 80sFanKid (Feb. 19, 2019 21:45:11)



“No problem can be solved from the same level of consciousness that created it.”
Albert Einstein
Anonymous1212144
Scratcher
100+ posts

How would one make a neural network?

It depends on whether you want to manually input the training sets or automatically input it.
80sFanKid
Scratcher
44 posts

How would one make a neural network?

i ask another question, (two) what does it do, and if nothing, what is it built to do?
and, is this code good?
when green flag clicked
set [ i v] to [2]
set [ c v] to [0]
set [ w v] to [0]
forever
set [ w v] to (pick random (1) to (10000000000000))
set [ o v] to ((1) / ((1 +e^(-iw)
change [w v] by ((t)(c-o)(o)(1-0)
end

Last edited by 80sFanKid (Feb. 19, 2019 21:52:56)



“No problem can be solved from the same level of consciousness that created it.”
Albert Einstein
Anonymous1212144
Scratcher
100+ posts

How would one make a neural network?

This one originally built to find the pattern in a few sets of numbers, but I generalized it so it could do pretty much anything if you know how to use it.
80sFanKid
Scratcher
44 posts

How would one make a neural network?

ah, okay. should i give it a set of numbers to find a pattern with, or does it do that manually?


“No problem can be solved from the same level of consciousness that created it.”
Albert Einstein
80sFanKid
Scratcher
44 posts

How would one make a neural network?

and, how would i do it?


“No problem can be solved from the same level of consciousness that created it.”
Albert Einstein
Anonymous1212144
Scratcher
100+ posts

How would one make a neural network?

You need to give examples to it. For example, something like this:




P.S. this is what it is originally built to solve.
80sFanKid
Scratcher
44 posts

How would one make a neural network?

okay, i see! how would i give it the information needed?


“No problem can be solved from the same level of consciousness that created it.”
Albert Einstein
Anonymous1212144
Scratcher
100+ posts

How would one make a neural network?

You store the inputs in a 2d list, and the outputs in a 1d list, then process that information.
80sFanKid
Scratcher
44 posts

How would one make a neural network?

what is a 2d/1d list?

and how would i make it?

Last edited by 80sFanKid (Feb. 19, 2019 22:11:51)



“No problem can be solved from the same level of consciousness that created it.”
Albert Einstein
Anonymous1212144
Scratcher
100+ posts

How would one make a neural network?

A 1d list:
{1, 2, 3}

A 2d list:
{{1, 2, 3},
{4, 5, 6},
{7, 8, 9}}

In other words, a 2d list is a list of 1d lists.

A 1d list is just a normal list, a 2d list does not exist in scratch normally, but there are workarounds to it.

Last edited by Anonymous1212144 (Feb. 19, 2019 22:14:06)

Powered by DjangoBB