seanshpark / help

common help
MIT License
4 stars 0 forks source link

Neural network to matrix calculation #4

Closed seanshpark closed 7 years ago

seanshpark commented 7 years ago

In a Layer, there are N neurons. For a neuron n, where 0 <= n < N, having P input with W[p] weights where 0 <= p < P

sumweights = sum(W[p] * input[p])
output[n] = 1.0 / (1.0 + exp(-1.0 * gain * sumweights))

https://en.wikipedia.org/wiki/Artificial_neuron#Basic_structure

input weight 
  0 --   w[0] --+-- sigmoid --
  1 --   w[1] --+
  .  
  p --   w[p] --+
  .
P-1 -- w[P-1] --+

sigmoid function: https://en.wikipedia.org/wiki/Sigmoid_function

seanshpark commented 7 years ago
sum(w[p] * input[p]), where 0 <= p < P

How to run this with OpenGLSL?

seanshpark commented 7 years ago

To read: http://www.lighthouse3d.com/tutorials/glsl-12-tutorial/shader-examples/

seanshpark commented 7 years ago

Use QPULib.