Jump to content




Artificial Inteligence in ComputerCraft - NeuralNetworks


  • You cannot reply to this topic
146 replies to this topic

Poll: Artificial Inteligence in ComputerCraft - NeuralNetworks

Do you like the idea?

You cannot see the results of the poll until you have voted. Please login and cast your vote to see the results of this poll.

Do you like this implemetation?

You cannot see the results of the poll until you have voted. Please login and cast your vote to see the results of this poll.
Vote Guests cannot vote

#81 Rougeminner

  • Members
  • 151 posts

Posted 10 November 2015 - 05:08 AM

well more or less what i was trying to do was a project to get myself used to this, it took me a while just to understand what the numbers represented in NN and i still don't fully get it :P

#82 Creator

    Mad Dash Victor

  • Members
  • 2,168 posts
  • LocationYou will never find me, muhahahahahaha

Posted 10 November 2015 - 05:13 AM

Which numbers exactly?

#83 H4X0RZ

  • Members
  • 1,315 posts
  • LocationGermany

Posted 10 November 2015 - 07:12 AM

View PostCreator, on 10 November 2015 - 05:13 AM, said:

Which numbers exactly?
Here is a block distribution graph: http://hydra-media.c...erworld_1.5.svg

And a quote from the MC forums:

Quote

(1:0),Stone,5229129
(1:1),Stone,278532
(1:3),Stone,269447
(1:5),Stone,293764
(3:0),Dirt,334311
(13:0),Gravel,88583
(14:0),Gold Ore,3611 (9.03 ore per chunk, +10%)
(15:0),Iron Ore,38577 (96.4 ore per chunk, +25%)
(16:0),Coal Ore,74691 (186.7 ore per chunk, +31%)
(21:0),Lapis Lazuli Ore,1490 (3.73 ore per chunk, +9%)
(56:0),Diamond Ore,1376 (3.44 ore per chunk, +10%)
(73:0),Redstone Ore,10567 (26.4 ore per chunk, +6.4%)

Edited by H4X0RZ, 11 November 2015 - 12:19 PM.


#84 Creator

    Mad Dash Victor

  • Members
  • 2,168 posts
  • LocationYou will never find me, muhahahahahaha

Posted 10 November 2015 - 07:48 AM

Since there is a pattern, there also is a way to train it. I will explain it after school when I am on my PC.

#85 Rougeminner

  • Members
  • 151 posts

Posted 11 November 2015 - 06:03 AM

so i am trying to learn this stuff and i literally just started yesterday because i saw your thread and i have a few beginning questions, how to i teach it the appropriate outcome, second what do your numbers mean i think they represent probability but of what (if i am completely wrong please say so i will miserably fail over and over until i get it right though in the case of an AI it will take a life time :P) thanks in advance. Rougeminner



oops i didn't even see the conversation from my second post, i mean the numbers when you tell it the first input is 1400 and the second is 1000 it simply replies with a number <1 and i just can't figure that one out like i said i think its probability but of wut?

Edited by Rougeminner, 11 November 2015 - 06:04 AM.


#86 クデル

  • Members
  • 349 posts

Posted 11 November 2015 - 06:29 AM

You should include an expected result, for training purposes and a fitness level or something.

#87 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 11 November 2015 - 06:31 AM

To my limited understanding, you put a number in, it gives you a number out, and you also tell it what number you actually wanted out. The more times you tell it "this input should result in this output", the closer its output will actually get to your desired result, as it'll adjust itself a little each time you repeat the process.

The idea is that by teaching it a great variety of inputs and associated outputs, it should eventually catch on to whatever pattern it is you're following and start to produce the right outputs for inputs you haven't shown it before, without having to be shown the expected outputs at all. But there has to be a pattern to the numbers you're feeding in, as feeding garbage in will only get you garbage out.

(Think of it as being like teaching a person - show them how to hammer a red nail, then show them how to hammer a green nail, and odds are they'll have a pretty good idea what to do with blue nails before you tell them.)

For example, with something like TicTacToe, there are just two rules to follow ("make lines of three" and "don't let the opponent make lines of three") - but there are so few moves that're actually worth making that it's easier just to teach a network all the best moves (each one being simple) than it is to try and teach it those rules (which are relatively complex).

With something like waifu2x (an NN-based image upscaler), things get a bit more complex. There are TONS of patterns - certain alignments of pixels should result in certain other alignments of pixels, based on which other alignments of pixels are nearby, and so on. By saving (lots of!) high-res images in low-res and feeding the pairs in as the expected outputs and inputs respectively, a correctly setup network (someone's got to translate the numbers for it!) should eventually be able to produce decent looking high-res images from low-res ones without ever seeing the original high-res versions (dead handy if you didn't have the originals in the first place!).

#88 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 11 November 2015 - 08:02 AM

I think waifu2x is a great example of one of the two hardest problems in programming (and it's not the cache invalidation one).

#89 Rougeminner

  • Members
  • 151 posts

Posted 11 November 2015 - 08:39 AM

so, if i do
myNet.feedForward({1000,100})
myNet.backProp({.5})
it should learn that 1000,100's output should be five?
(its me thats learning not the AI)

#90 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 11 November 2015 - 08:44 AM



View PostLyqyd, on 11 November 2015 - 08:02 AM, said:

I think waifu2x is a great example of one of the two hardest problems in programming (and it's not the cache invalidation one).

Ah, it'll be the off-by-one error, then!

#91 Creator

    Mad Dash Victor

  • Members
  • 2,168 posts
  • LocationYou will never find me, muhahahahahaha

Posted 11 November 2015 - 09:53 AM

View PostRougeminner, on 11 November 2015 - 08:39 AM, said:

so, if i do
myNet.feedForward({1000,100})
myNet.backProp({.5})
it should learn that 1000,100's output should be five?
(its me thats learning not the AI)

The dlidea is that you give many examples so the AI can find a pattern and react accordingly.

#92 Rougeminner

  • Members
  • 151 posts

Posted 11 November 2015 - 11:38 AM

So what am i teaching it exactly? Like i said i am just starting and i am in the screw around with it phase of my learning method, so in english what pattern is it would it be something like 1000 and 100 = .5?

#93 Creator

    Mad Dash Victor

  • Members
  • 2,168 posts
  • LocationYou will never find me, muhahahahahaha

Posted 11 November 2015 - 12:11 PM

Let's say you want to teach it XOR.
The net has this configuration: 2 4 1
Then then in puts and outputs look like this
0 0 : 0
1 1 : 0
1 0 : 1
0 1 : 1

After passing these inputs a few hundred times, the network will learn.

#94 H4X0RZ

  • Members
  • 1,315 posts
  • LocationGermany

Posted 11 November 2015 - 12:17 PM

View PostRougeminner, on 11 November 2015 - 11:38 AM, said:

So what am i teaching it exactly? Like i said i am just starting and i am in the screw around with it phase of my learning method, so in english what pattern is it would it be something like 1000 and 100 = .5?

//Kinda-Off-Topic
IIRC you asked what the stuff I posted meant (or how to utilize it).

In the quote you can see how many blocks of an ore are found in one chunk (±some percent). Using the chart you can see on which "layers" it's more probable to find a specific ore.

That *should* allow you to tell your "AI" 1. on which layer a specific Kind of ore can be found and 2. how many blocks of that ore appear.

Although this isn't too usable when mining for multiple ores at the same time, it should allow you to get one specific ore "fast". (Like skipping chunks you already farmed n-blocks.)

Edited by H4X0RZ, 11 November 2015 - 12:18 PM.


#95 LeDark Lua

  • Members
  • 369 posts
  • LocationLeLua

Posted 11 November 2015 - 12:20 PM

View PostLupus590, on 03 November 2015 - 09:35 PM, said:

Does this neural network only accept and output numbers? Or can I use chars/strings too?
Actually this should output 1/0 or true/false.

Edited by LeDark Lua, 11 November 2015 - 12:21 PM.


#96 Rougeminner

  • Members
  • 151 posts

Posted 11 November 2015 - 12:32 PM

So by saying myNet.backProp({.5}) thats telling it the output thanks i think i finally got myself a small enough foundation to build of of once i really took a look at creators port

View PostCreator, on 11 November 2015 - 12:11 PM, said:

The net has this configuration: 2 4 1
Then then in puts and outputs look like this
0 0 : 0
1 1 : 0
1 0 : 1
0 1 : 1



oh and one more thing, i tried doubling the net configuration myNet.Net({4,8,2}) and this didn't work so well, what did i do wrong? is it the two output neurons?

also words don't explain how stupid i feel... i went back and looked at NN had i taken the time to look i would have noticed that thats an XOR

Edited by Rougeminner, 11 November 2015 - 12:56 PM.


#97 Creator

    Mad Dash Victor

  • Members
  • 2,168 posts
  • LocationYou will never find me, muhahahahahaha

Posted 11 November 2015 - 12:56 PM

Why did you double it?

#98 Rougeminner

  • Members
  • 151 posts

Posted 11 November 2015 - 01:09 PM

to see what would happen just experimenting i now know that doubling it is bad but i can't figure out why

#99 Rougeminner

  • Members
  • 151 posts

Posted 11 November 2015 - 01:36 PM

<NOOB Concept>
If i convert the input text from read to ASCII numbers for example A OK is 65 79,75 and i put them together like so
myNet.feedForward({65,7975}) -- this is A OK in numbers
myNet.backProp({71797968}) -- this is Good in numbers
then i could interpret it back to char's and then have a texting AI? is this a valid concept (correct me if i got the numbers wrong please)

#100 Creator

    Mad Dash Victor

  • Members
  • 2,168 posts
  • LocationYou will never find me, muhahahahahaha

Posted 11 November 2015 - 01:49 PM

The input should be binary. I think it can work with bigger/smaller numbers but it is preferable to use binary. Also, when inputting text, take each character and convert it to binary (255 ==> 10000000 OR 4 ==> 00000100) Then, you take each binary number (00000100 ==> {0,0,0,0,0,1,0,0}) and put them in a table. Then you net.feedForward({0,0,0,0,0,1,0,0})

Also, some users have voted they didn't find this implementation good. I'd like to know what you didn't like, so I can optimize/change the code.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users