Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

Tournicoti

Member Since 30 Aug 2009
Offline Last Active May 23 2013 07:38 AM
**---

Posts I've Made

In Topic: [C#] Need help with Hopfield ANN

08 May 2013 - 11:45 PM

Hello smile.png

 

I hope the comments will help.

Anyway please feel free to ask for precisions.

 

The application uses a network of 10*8 nodes.

You can paint (left/right buttons) the panel to change the network state.

You press compute to get the next stable state.

 

I'm a bit lazy, I 've put only '0', '1' and '2' digits in the dataset tongue.png , but you can add more if you want (max 11 patterns)

 

Good luck !

 

The network implementation is divided into 2 classes :

HopfieldUnit.java which defines the behavior of an unit. (output computing and learning)

HopfieldNetwork.java which defines standard Hopfield Network. (asynchronous computing and a Hebbian offline learning method)

 

The file Patterns.java defines the patterns to be learnt . For now, 3 patterns ('0', '1', '2') are defined, but some others can be added directly.

 

The others are just UI stuff so let's ignore them happy.png


In Topic: [C#] Need help with Hopfield ANN

08 May 2013 - 07:03 AM

Hello

Ok, I'm doing something in java. Something with digits. The user draws a digit as  input, and the network answers the nearest learned digit from it.

Not sure if I'll be able to post it today , but I do as fast as I can wink.png


In Topic: [C#] Need help with Hopfield ANN

07 May 2013 - 06:57 PM

Not sure if you did this in your initialization, but in the weight matrix  :

 

Mat i,i=0

Mat i,j= Mat j,i

 

... is generally used : it permits to be sure the network will reach a stable state.

 

 

 

The capacity of a hopfield network is approximately nbPatterns=0.138*nbNodes, so 4 nodes is too small, maybe try with 10x10 nodes ( about 13 patterns in term of capacity )

 

I noticed you have implemented a synchronous method to compute the network state. It's totally possible even if initially, it was supposed to be asynchronous and stochastic.

 

Hope it can help !smile.png

 

If you still have problems with your implementation, I can post some pseudo-code if necessary


In Topic: Having a hard time understanding how a Hopfield ANN works

02 May 2013 - 09:46 AM

Hello smile.png

 

The final output vector will then be –2, 1, –2, 1

 

You have to pass this to the activation function which is, typically in Hopfield Network :

f(x)=1 if x>0, -1 otherwise

 

A vector (input/output)  of Hopfield network can only consists in -1 and 1 (At least in discrete model)

 

Good luck smile.png

 

In the stochastic version, you choose randomly an unit, compute its ouput (integrate inputs + activation function), until you get a stable network state (vector)


In Topic: Is this a bad programming paradigm?

15 April 2013 - 12:26 PM

instead of

public override void setSomething(boolean something)
{
      throw new Exception("This function is not supported in the sub class");
}

 

use this :

protected override void setSomething(boolean something)
{
}

or

private override void setSomething(boolean something)
{
}

so that the user of the B's class object can't call void setSomething(boolean something)

 

Maybe you can look for information on public, protected and private keywords ?

 

[EDIT]

So apparently illegal ... in C#


PARTNERS