+ Reply to Thread
Page 11 of 22 FirstFirst ... 91011121321 ... LastLast
Results 101 to 110 of 216
Like Tree1Likes

Thread: The gBrain Project

  1. #101
    Wiremod Helper Lyinginbedmon's Avatar
    Join Date
    Mar 2009
    Location
    England
    Posts
    2,659

    Default Re: The gBrain Project

    Just don't give it a module to allow it to talk to the console and a grasp of language and you should be fine.
    Quote Originally Posted by SystemsLock View Post
    That's not really a learning algorithm...

    I suppose it is but not a very useful one.
    It's the same one that's been discussed for the last few pages, and it's noted right above Backpropagation in the tutorial you posted, so clearly it's some use

    The Olympus Technologies drones, totally not SkyNet in Gmod form.
    Cronus: The Ultimate Drone, definitely SkyNet in Gmod form.
    The gBrain Project, the drone controls system that thinks it's better than you

  2. #102
    Wire Sofaking SystemsLock's Avatar
    Join Date
    Mar 2009
    Posts
    474

    Default Re: The gBrain Project

    So it's an evolving network?
    Make a Small Loan, Make a Big Difference - Check out Kiva.org to Learn How!

  3. #103
    Wiremod Helper Lyinginbedmon's Avatar
    Join Date
    Mar 2009
    Location
    England
    Posts
    2,659

    Default Re: The gBrain Project

    Quote Originally Posted by SystemsLock View Post
    So it's an evolving network?
    The code I posted is for one, singular, neuron. I was having trouble resolving the issues with my previous loop-based system so I went back to a more solid-state implementation in order to resolve the issues on the small scale and then propagate them to a greater system by moving the neuron functionalities into a loop.

    Working on implementing backpropagation in the same hardware system, instead of the forward-propagation it currently uses, but there do seem to be issues with this idea. For one, there's far more interactivity between neurons, and smaller networks may learn slower than larger ones as a consequence of the ripple of change.

    Thus far, each neuron needs the usual input data inputs, as well as an input for backpropagation linking to each and every neuron in the next layer, with the outputs for backpropagation and the usual output value. This already means every neuron layer closer to the input layer has increasingly greater connectivity as the number of neurons in the following layer increases, though in a looping system this could be done with persisted arrays far easier than with individual chips.

    The internal mechanism however is thus far the easiest part of the conversion, the issue for a hardware model is in the addition and subtraction of unnecessary inputs, presently trying to use a base model with 10 forward BProp inputs and 10 backward data inputs.
    Last edited by Lyinginbedmon; 03-16-2010 at 09:51 AM.

    The Olympus Technologies drones, totally not SkyNet in Gmod form.
    Cronus: The Ultimate Drone, definitely SkyNet in Gmod form.
    The gBrain Project, the drone controls system that thinks it's better than you

  4. #104
    Wiremod Helper Lyinginbedmon's Avatar
    Join Date
    Mar 2009
    Location
    England
    Posts
    2,659

    Default Re: The gBrain Project

    Right, current model of a backpropagation neuron
    Code:
    @name Neuron
    @inputs [In1 In2 In3 In4 In5 In6 In7 In8 In9 In10] End
    @inputs [Ou1 Ou2 Ou3 Ou4 Ou5 Ou6 Ou7 Ou8 Ou9 Ou10]
    @persist Weights:array N ID It NetOut
    @outputs OUT ID
    
    if(first()){
            #Learning rate
        Learn=0.25
            #T is the target, a string (to allow learning towards zero)
        
        ID=entity():id()
        
            #Initial randomised weights
        Weights=array()
        for(V=1,10){
            Weights:pushNumber(round(random(-1,1),2))
        }
        
            #Indication holograms
            B=entity():toWorld(vec(0,0,5))
            A=entity():angles()
        holoCreate(1,B,vec(),A) holoCreate(2,B,vec(),A)
        holoModel(1,"pyramid") holoModel(2,"pyramid")
        holoScaleUnits(1,vec(1,1,1)) holoScaleUnits(2,vec(5,5,5))
        holoParent(1,entity()) holoParent(2,entity())
        holoAlpha(2,170)
    }
    interval(150)
        #Input data (previous layer) and forward data IDs (next layer)
        Input=array() IDs=array()
    Input:pushNumber(gGetNum(In1))    IDs:pushNumber(Ou1)
    Input:pushNumber(gGetNum(In2))    IDs:pushNumber(Ou2)
    Input:pushNumber(gGetNum(In3))    IDs:pushNumber(Ou3)
    Input:pushNumber(gGetNum(In4))    IDs:pushNumber(Ou4)
    Input:pushNumber(gGetNum(In5))    IDs:pushNumber(Ou5)
    Input:pushNumber(gGetNum(In6))    IDs:pushNumber(Ou6)
    Input:pushNumber(gGetNum(In7))    IDs:pushNumber(Ou7)
    Input:pushNumber(gGetNum(In8))    IDs:pushNumber(Ou8)
    Input:pushNumber(gGetNum(In9))    IDs:pushNumber(Ou9)
    Input:pushNumber(gGetNum(In10))    IDs:pushNumber(Ou10)
        #For ease of reference and collection, stored in arrays
    
        #Output production
    O=0
    for(V=1,Input:count()){
        O+=Input[V,number]*Weights[V,number]
    }
    OUT=1/1-exp(-O)
        gSetNum(ID,OUT)
        #Network output definer (Wire 1 into End if multiple chips)
    if(!IDs:sum()|End){gSetNum("NetOut",OUT)}
    
        #Backpropagation
    NetOut=gGetNum("NetOut")    #Network output
    if($NetOut){
        N=gGetStr("Target"):toNumber()   #Target output
        Error=N-NetOut  #Network error
        if($N){
                #Forward alteration
            Fo=0
            for(V=1,Input:count()){
                IPlus=gGetNum(Input[V,number])
                Fo+=IPlus
            }
            For=Fo/Input:count()
            
                #Weight modification
            for(V=1,Input:count()){
                W=Weights[V,number]
                W+=Learn*Error*OUT*(IDs:sum() ? For*(1-For) : 1)
            }
            
            S=((1-Error)/(!N ? 1 : N))*5
            holoScaleUnits(1,vec(S,S,S))
            
            if(Error){
                holoColor(1,vec(1,1,1)*255)
                It=1
            }
            else{
                holoColor(1,vec(0,1,0)*255)
                if(It){
                    #holoEntity(1):soundPlay(1,0,"buttons/blip1.wav")
                    soundPitch(1,150)
                    
                    It=0
                }
            }
        }
    }
    
        #Rebooting simultaneous with nearby training chip
    runOnSignal("Start",1,1)
    Dis=signalSender():pos():distance(entity():pos())
    if(signalClk("Start") & Dis<=100){
        reset()
    }
    It's presently nonfunctional, though it does show some effort to reach the target and definitely responds to stimuli. I'm not sure what the inherent problem is but I believe it's in the weight modification formula (Attained and converted to E2 from this tutorial on the matter). All aid towards making it functional would be greatly appreciated. It already seems to respond faster than forwardpropagation, just need to figure out the kinks.

  5. #105
    Wire Sofaking SystemsLock's Avatar
    Join Date
    Mar 2009
    Posts
    474

    Default Re: The gBrain Project

    Out of curiosity what kind of ops usage are you getting on just the forward propagation of a multi-neuron network?

    It's kinda hilarious how bad E2's performance is. After doing most of my programing in E2, then trying out Java, I was stunned to find I could generate 100 networks, with 100 neurons, and run each network 100 times, in the blink of an eye. If I tried that in E2 it would have hit the red limit for sure.
    Make a Small Loan, Make a Big Difference - Check out Kiva.org to Learn How!

  6. #106
    Wiremod Helper Lyinginbedmon's Avatar
    Join Date
    Mar 2009
    Location
    England
    Posts
    2,659

    Default Re: The gBrain Project

    In a slightly poor performance mode the backprop is running about 23%, usually less than 15% though. Forwardprop is running way lower, I don't think it often goes over 10% ops. This is just individual neurons in individual chips though, looping the sequence into a single chip will probably bring the ops up quite a bit, but probably not enough to redchip as long as you don't do the ridiculous.

    For some reason that backpropagation code only seems to modify it's weights once right at the start of functioning, then sticks with what it has perpetually. I'm not sure what's causing this...

    The Olympus Technologies drones, totally not SkyNet in Gmod form.
    Cronus: The Ultimate Drone, definitely SkyNet in Gmod form.
    The gBrain Project, the drone controls system that thinks it's better than you

  7. #107
    Lifetime Supporter Nikita's Avatar
    Join Date
    May 2009
    Posts
    769

    Default Re: The gBrain Project

    So with all this back-and-forth propagation talk I'm a little confused about what stage is this project at...

    PS: Lying has almost 2^11 posts

  8. #108
    Wiremod Helper Lyinginbedmon's Avatar
    Join Date
    Mar 2009
    Location
    England
    Posts
    2,659

    Default Re: The gBrain Project

    The propagation is part of the neurons that comprise the Intuition side. Once those are worked out, the Pattern side is needed, which uses genetic algorithms. Once both sides are operational, the central core needs to be done to link the two and mediate responses.

    So right now we're building the Intuition side from the ground up. But we're doing pretty well so far.

  9. #109
    Wiremod Helper Lyinginbedmon's Avatar
    Join Date
    Mar 2009
    Location
    England
    Posts
    2,659

    Default Re: The gBrain Project

    Okay, try as I might, I just can't get the backprop chip to work, I think it's probably something wrong with the order of code lines but I'm having trouble finding where the issue is precisely. Does anyone else want to give fixing it a shot?

  10. #110
    Lifetime Supporter Nikita's Avatar
    Join Date
    May 2009
    Posts
    769

    Default Re: The gBrain Project

    Hey, just stumbled upon this, you might want to look at it after you've got back propagation working:
    generation5 - Using Genetic Algorithms with Neural Networks
    It's saying that you can somehow use genetic algorithms instead for evolving the weights - sometimes it's faster that BP, sometimes it's slower, as I understand (not that I know a whole lot about either neural nets or generic algs)

+ Reply to Thread
Page 11 of 22 FirstFirst ... 91011121321 ... LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
proceed-collector
proceed-collector
proceed-collector
proceed-collector
linguistic-parrots
linguistic-parrots
linguistic-parrots
linguistic-parrots