machine learning - Using an ANN to calculate a position vector's length and the angle between it and the x-axis -
i'm new neural networks , trying hang of solving following task:
given semi circle defines area above x-axis, teach ann output length of vector pointing position within area. in addition, know angle between , x-axis.
i thought of classical example of supervised learning , used backpropagation train feed-forward network. network built 2 input-, 2 output-, , variable amount of hidden-neurons organised in variable amount of hidden layers.
my training data random , unsorted sample of points within area , respective desired values. coordinates of points serve input of net while use calculated values minimise error.
however, after thousands of training iterations , empirical changes of networks topology, unable produce results error below ~0.2 (radius: 20.0, topology: 2/4/2).
are there obvious pitfalls i'm failing see or chosen approach not fit task? other network types and/or learning techniques used complete task?
i wouldn't use variable amounts of hidden layers, use one.
then, wouldn't use 2 output neurons, use 2 separate anns, 1 each of values you're after. should better, since outputs aren't related in opinion.
then, experiment number of hidden neurons between 2 , 10 , different activation functions (logistic
, tanh
, maybe relus).
after that, scale data? might worth scaling both inputs , outputs. sigmoid units return small numbers, if can adapt outputs small (in [-1 , 1]
or [0, 1]
). example, if want angles in degrees, divide of targets 360
before training ann on them. when ann returns result, multiply 360
, see if helps.
finally, there number of ways train neural network. gradient descent classic, not best. better methods conjugate gradient, bfgs etc. see here optimizers if you're using python - if not, might give idea of search in language.