Nathan
Nathan

Reputation: 78439

Neural Network bias

I'm building a feed forward neural network, and I'm trying to decide how to implement the bias. I'm not sure about two things:

1) Is there any downside to implementing the bias as a trait of the node as opposed to a dummy input+weight?

2) If I implement it as a dummy input, would it be input just in the first layer (from the input to the hidden layer), or would I need a dummy input in every layer?

Thanks!

P.S. I'm currently using 2d arrays to represent weights between layers. Any ideas for other implementation structures? This isn't my main question, just looking for food for thought.

Upvotes: 0

Views: 473

Answers (1)

sashkello
sashkello

Reputation: 17871

  1. Implementation doesn't matter as long as the behaviour is right.

  2. Yes, it is needed in every layer.

  3. 2d array is a way to go.

I'd suggest to include bias as another neuron with constant input 1. This will make it easier to implement - you don't need a special variable for it or anything like that.

Upvotes: 1

Related Questions