• Content count

  • Joined

  • Last visited

Community Reputation

122 Neutral

About Sirveaux

  • Rank
  1. Actually, I discovered that my major problem was that I wasn't normalizing my input. I had some inputs that were in the range 0 - 60,000 while other inputs between 0 - 50. So, I've scaled them all down so that they are now between -1 and 1 and it performs much better. I've also added momentum to it, which seems to help it keep from getting stuck as frequently. It's working much better now, and I've actually had it navigate around the wall and find the target on its own a few times. I think the network is in pretty good shape. Mainly I think I need to adjust the sensors to present more meaningful data (I may have to add a couple more inputs as well). Thanks for the help! Of course, any other suggestions you might have are welcome.
  2. I wrote my first artificial neural network implementation the other day and got it working great for XOR and a few other simple functions I gave it. It seemed a little slow at times, but it would usually eventually get the error sum for each epoch down to a reasonable level. I've decided to give it something a little more complex and now I'm having some issues. The network consists of 7 inputs, 4 outputs, and currently, a single hidden layer with 6 neurons in it. It uses backprop for training and, while I've tried a learning rate with a wide range of values, it's currently set at 0.5. I'm trying to train the network to navigate an agent around a single wall and toward a target location. The 7 inputs are the lengths of 3 rays that extend out to find walls and 4 activation levels of radar wedges around the agent that return information about the target. As it is, the training set ends up being around 150 entries in length (they are recorded at every time step as I drive the agent around the wall toward the target). I've reduced this to as low as 6 and I still get the same problem: the change in the error sum eventually levels off to the point where it's no longer decreasing, even though the sum may be something like 30.0 or 40.0 (whereas I'm trying to get it to 0.01). Sometimes, the error will actually INCREASE over the course of the training. I can't figure out if this is a problem with my data set or with my network training implementation. Here's basically what my code is doing (or what I think it's doing, anyway): For each training set For each neuron in the output layer Set the error value of this neuron to: error=(target output - actual output) * actual output*(1 - actual output) error sum += (target output - actual output) squared For each weight from the hidden layer to the output layer new weight += error * learning rate * activation of hidden layer neuron Next weight new bias weight += error * learning rate * bias (bias is 1) Next outer layer neuron For each neuron in the hidden layer error = 0 For each neuron in the outer layer error += outer neuron error * weight from hidden to outer Next outer layer neuron error *= hidden neuron activation * (1 - hidden neuron activation) For each weight from inputs to the hidden layer hidden neuron weight += error * learning rate * input value associated with this weight Next weight new hidden bias weight += error * learning rate * bias Next hidden layer neuron Next training set ============== If you've made it this far, I thank you. If any clarification is needed, let me know. I'd appreciate any help you can offer.
  3. I need people to test out my picture captioning game called Words That Follow. If anyone used to play the now defunct Get The Picture, then you'll know how to play this. Let me know what you think (either on here, or by using the /bug chat command in the game).
  4. I have made a multiplayer picture captioning game in Java that I'd like to test with more than the normal 3 - 6 people I usually have playing. If anyone would like to help me try it out, you can get it from: One of the main things I'm looking for feedback on is any lag issues, missing captions, or pictures not showing up. If you come across anything funky, use the /bug command in that chat input box and let me know what happened. Thanks for the help.
  5. Java: Thread/paint conflict

    I have a thread for my main game loop that calls repaint() at the end, right before it sleeps. A problem occurs when the painting is not finished and the sleep ends. The player location is changed while in the middle of painting, which causes some jumping around of the display. I have tried this to fix it: boolean paint_done; //... public void paint(Graphics g) { paint_done = false; // PAINT STUFF paint_done = true; notifyAll(); } public void run() { //... while (!paint_done) gameThread.wait(); // Perform player movement, etc... } But, both my wait() and epsecially my notifyAll() throw an IllegalMonitorStateException everytime. I'm not really sure why this is or what I'm doing wrong. Any suggestions would be appreciated.
  6. Hmm. Registration? I'm not exactly sure what you mean, but if you think it could be a better/cleaner approach, I'd like to see it.
  7. I'm having trouble deciding which is the best way to go with this. My game has a few different interfaces that the player interacts with. The normal moving around the world interface, the shopping interface, and the battle interface. Currently, my main applet class is set as the KeyListener. One way I could handle the different input for the various states is to just have a big switch statement in the key events for the applet's class that checks a state flag and processes the input there. Or, I could set up an object for each interface and make them KeyListeners that are added and removed, depending on what the player is doing. Or, I could still just use the applet's class as the keylistener, check the state flag and then manually call the KeyPressed/KeyReleased methods from within those methods in the main class. In other words: Option 1: (within my applet class) public void KeyPressed (KeyEvent e) { switch (state) { case STATE_MOVEMENT: // process key event case STATE_BATTLE: // process key event ... } } Option 2: I'd have a few classes classes (MovementKeyListener, BattleKeyListener, ShoppingKeyListener, etc), each one interfacing KeyListener. When the player enters a battle, for example, the MovementKeyListener object would be removed and the BattleKeyListener would be added. Option 3: Like option #2, but without adding/removing any KeyListeners. public void KeyPressed (KeyEvent e) { switch (state) { case STATE_MOVEMENT: MovementKeyListener.KeyPressed(e); case STATE_BATTLE: BattleKeyListener.KeyPressed(e); ... } } Assuming you can make any sense of what I tried to say there, which would be the better way to go (if any)? Or does it really matter? I'd prefer not to have all of the key events handled within the main class just for organization's sake. So I'm thinking either option 2 or 3.