Closed hugo4715 closed 7 years ago
Hum, i have no clue.
Firstly I appreciate the interest you bring for the repository. I want to mention that the library is missing many assertions. Also, every feature has been tested empirically and therefore probably contains bugs/may not work as expected.
Your code is correct and it's actually working as intented. What happened is that the network got stuck in a local optimum. XOR is not an easy function to learn. You gave your network only two hidden units and although there exist a solution for this configuration, it's unlikely to find it. In the example I provided I set the default number of hidden units to 10 and it gave me much better results. Moreover I recommend you to use the Adadelta trainer : you don't have to set a learning rate since it automatically calculates it during the runtime, and it converges very quickly.
Edit: Forgot to amend
Hi, I'm trying out this lib, and using a simple XOR as the input vector, but i cannot figure out what is wrong with my code. ` public static void main(String[] args) { System.out.println("XOR starting"); final Network network = new Network.Builder(new Dimensions(2)) .hookFullyConnected(new Dimensions(2),ActivationFunctionType.SIGMOID) .hookFullyConnected(new Dimensions(1),ActivationFunctionType.SIGMOID) .build(OutputFunctionType.MEAN_SQUARES);
` Thanks