Click here to Skip to main content
15,889,266 members
Home / Discussions / C#
   

C#

 
Questioncompile App.config in the EXE or as DLL Pin
Jassim Rahma9-Oct-10 2:52
Jassim Rahma9-Oct-10 2:52 
QuestionWant to move a object in a window Pin
ranjan kumar saha8-Oct-10 10:43
ranjan kumar saha8-Oct-10 10:43 
AnswerRe: Want to move a object in a window Pin
Luc Pattyn8-Oct-10 16:50
sitebuilderLuc Pattyn8-Oct-10 16:50 
AnswerRe: Want to move a object in a window Pin
ekba8910-Oct-10 5:52
ekba8910-Oct-10 5:52 
QuestionRE: Save user's re-order grid preferences Pin
roman_s8-Oct-10 7:32
roman_s8-Oct-10 7:32 
AnswerRe: RE: Save user's re-order grid preferences Pin
Searril8-Oct-10 8:03
Searril8-Oct-10 8:03 
GeneralRe: RE: Save user's re-order grid preferences Pin
Richard Andrew x648-Oct-10 12:13
professionalRichard Andrew x648-Oct-10 12:13 
GeneralRe: RE: Save user's re-order grid preferences Pin
Searril9-Oct-10 6:53
Searril9-Oct-10 6:53 
AnswerRe: RE: Save user's re-order grid preferences Pin
PIEBALDconsult8-Oct-10 15:51
mvePIEBALDconsult8-Oct-10 15:51 
AnswerRe: RE: Save user's re-order grid preferences Pin
Mycroft Holmes9-Oct-10 2:31
professionalMycroft Holmes9-Oct-10 2:31 
GeneralRe: RE: Save user's re-order grid preferences Pin
roman_s12-Oct-10 7:19
roman_s12-Oct-10 7:19 
GeneralRe: RE: Save user's re-order grid preferences Pin
Mycroft Holmes12-Oct-10 12:50
professionalMycroft Holmes12-Oct-10 12:50 
Questioni write a backprobagate neural network code with c# and it is work slowly [modified] Pin
karayel_kara8-Oct-10 5:06
karayel_kara8-Oct-10 5:06 
AnswerRe: i write a backprobagate neural network code with c# and it is work slowly Pin
Not Active8-Oct-10 5:23
mentorNot Active8-Oct-10 5:23 
GeneralRe: i write a backprobagate neural network code with c# and it is work slowly Pin
Khaniya8-Oct-10 21:07
professionalKhaniya8-Oct-10 21:07 
AnswerRe: i write a backprobagate neural network code with c# and it is work slowly Pin
Abhinav S8-Oct-10 22:43
Abhinav S8-Oct-10 22:43 
AnswerRe: i write a backprobagate neural network code with c# and it is work slowly [modified] Pin
Keith Barrow9-Oct-10 7:41
professionalKeith Barrow9-Oct-10 7:41 
Are you still stuggling with this Smile | :) !

Please format your code, as you can see it is dificult to read and you are being down voted.

Point one: Nested loops = poor performance [generally].

Your class structure is wrongly IMO. Each Neuron should have a List<Dendrite> for both input and output. A Dendrite should have both an input and output Neuron as well as any weighting. You might need to put deltas in there too, I can't remember. There needs to be a special subclass for the Input Layer and Output layer as these don't have Input Neurons and Output Neurons respectively.

Set the activation inputs, and calculate the activations on each layer in succession. The calculation is easy:
//Pseudocode - in Neuron
InputAcivation = 0.0;
ForEach(Dendrite dendrite in InputDendrites)
   InputAcivation += dendrite.Activation;
Activation = Squash(InputActivation); // Where Squash is the Squashing function to put into range 0-->1 -1 -->1 or whatever 

Note that I have the Dendrite class calculaing the Activation from the input, "Weight * InputActivation".

The backprop works in a similar way (but reverse!) the desired output is placed onto a property on the output layer, and then each layered is worked back to the input. I really can't remember the ins and outs of this, but you only really need to loop over each neuron in each layer to do this, plus the dendrites.

One advantage of generic Lists over arrays (if you are having a speed problem) is that you can trim "dead" connections (ones whose weights are near zero and have little momentum over multiple tries. Another suggestion is to try to define Halting Criteria, which defines when the NNW is getting it right enough to stop learning. You can over-train a NNW.

One final thing, the OO encapsulation is poor IMO, the calculation code (as I have suggested above) should be in the Neurons, not the main code block. This goes for the backprop calcs too. If you do this, you won't have so many array calls confusing the mix, and you'll be able to profile your app a little better.

[Edit]
My class structure probably isn't the best, I last wrote a NNW ~10 years ago as an undergrad, in c++, but hopefully you'll get the idea. Did you check out the NNW article on CP I mentioned in your previous thread?
Sort of a cross between Lawrence of Arabia and Dilbert.[^]
modified on Saturday, October 9, 2010 2:06 PM

AnswerRe: i write a backprobagate neural network code with c# and it is work slowly Pin
karayel_kara10-Oct-10 23:13
karayel_kara10-Oct-10 23:13 
QuestionCustom TextSource creates TextRuns more than once Pin
WebMaster8-Oct-10 4:47
WebMaster8-Oct-10 4:47 
AnswerRe: Custom TextSource creates TextRuns more than once Pin
OriginalGriff8-Oct-10 5:26
mveOriginalGriff8-Oct-10 5:26 
QuestionDos Command Pin
M Riaz Bashir8-Oct-10 2:31
M Riaz Bashir8-Oct-10 2:31 
AnswerRe: Dos Command Pin
#realJSOP8-Oct-10 2:34
mve#realJSOP8-Oct-10 2:34 
GeneralRe: Dos Command Pin
M Riaz Bashir8-Oct-10 2:37
M Riaz Bashir8-Oct-10 2:37 
AnswerRe: Dos Command Pin
Pete O'Hanlon8-Oct-10 2:37
mvePete O'Hanlon8-Oct-10 2:37 
AnswerRe: Dos Command Pin
MasttsaM13-Oct-10 22:04
MasttsaM13-Oct-10 22:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.