# Learning in neuronal Networks needs seems to get stuck

**URL:** <https://discourse.processing.org/t/learning-in-neuronal-networks-needs-seems-to-get-stuck/15891>\
**Category:** Libraries\
**Created:** [November 27, 2019, 7:22pm UTC](https://discourse.processing.org/t/learning-in-neuronal-networks-needs-seems-to-get-stuck/15891 "2019-11-27T19:22:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![NumericPrime](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/numericprime/32/16318_2.png) [@NumericPrime](https://discourse.processing.org/u/NumericPrime)\
**Post date:** [November 27, 2019, 7:22pm UTC](https://discourse.processing.org/t/learning-in-neuronal-networks-needs-seems-to-get-stuck/15891/1 "2019-11-27T19:22:38Z")

</div>

Hi I’m using the Neuroph library from Java and I’m programming something to detect single numbers. But using even 2 samples the learning-process seems to get stuck here is the link where I got the jars.

[http://neuroph.sourceforge.net/download.html](http://neuroph.sourceforge.net/download.html)  
I took the jars put it in a folder with the name network put a folder with the Name library inside and there I put all jars in but called one network. Why doesn’t this work?  
Here is my code so far.

```auto
import org.neuroph.core.*;
import org.neuroph.core.data.*;
import org.neuroph.core.events.*;
import org.neuroph.core.exceptions.*;
import org.neuroph.core.input.*;
import org.neuroph.core.learning.error.*;
import org.neuroph.core.learning.*;
import org.neuroph.core.learning.stop.*;
import org.neuroph.core.transfer.*;
import org.neuroph.eval.classification.*;
import org.neuroph.eval.*;
import org.neuroph.nnet.*;
import org.neuroph.nnet.comp.*;
import org.neuroph.nnet.comp.layer.*;
import org.neuroph.nnet.comp.neuron.*;
import org.neuroph.nnet.learning.*;
import org.neuroph.nnet.learning.kmeans.*;
import org.neuroph.nnet.learning.knn.*;
import org.neuroph.util.benchmark.*;
import org.neuroph.util.*;
import org.neuroph.util.data.norm.*;
import org.neuroph.util.data.sample.*;
import org.neuroph.util.io.*;
import org.neuroph.util.plugins.*;
import org.neuroph.util.random.*;

DataSet data=new DataSet(400,10);
NeuralNetwork network=new MultiLayerPerceptron(400,400,200,100,50,10);
void setup() {stroke(0);
  strokeWeight(20);
  size(400, 400);
  background(255);
}
void draw() {
}
void keyPressed() {
  for(int i=0;i<10;i++) if(key==(i+"").charAt(0)){background(255);
  double outp[]={0,0,0,0,0,0,0,0,0,0};
  outp[i]=1;
  double getpixel[]=new double[400];
  for(int x=0;x<20;x++) for(int j=0;j<20;j++) getpixel[x+20*j]=blue(get(x*20,j*20))/255; 
  data.add(getpixel,outp);
  
  }
  if(key=='l') network.learn(data);
}
void mouseDragged() {point(mouseX,mouseY);
}

```

---

<div class="post-metadata">

**Author:** ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)\
**Post date:** [November 27, 2019, 10:43pm UTC](https://discourse.processing.org/t/learning-in-neuronal-networks-needs-seems-to-get-stuck/15891/2 "2019-11-27T22:43:42Z")

</div>

possibly it is about  
missing  
`library.properties` file

> **[processing/processing](https://github.com/processing/processing/wiki/Library-Basics)**
>
> Source code for the Processing Core and Development Environment (PDE) - processing/processing

  

> **[processing/processing](https://github.com/processing/processing/wiki/Library-Guidelines)**
>
> Source code for the Processing Core and Development Environment (PDE) - processing/processing

---

<div class="post-metadata">

**Author:** ![NumericPrime](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/numericprime/32/16318_2.png) [@NumericPrime](https://discourse.processing.org/u/NumericPrime)\
**Post date:** [November 28, 2019, 5:06pm UTC](https://discourse.processing.org/t/learning-in-neuronal-networks-needs-seems-to-get-stuck/15891/3 "2019-11-28T17:06:28Z")

</div>

I tried the original jars in Java it doesn’t work too.  
Here is the code for Java:

```auto
import org.neuroph.core.*;
import org.neuroph.core.data.*;

import org.neuroph.nnet.*;

import processing.core.*;
public class MainClass extends PApplet{
	DataSet data=new DataSet(400,10);
	@SuppressWarnings("rawtypes")
	NeuralNetwork network=new MultiLayerPerceptron(400,400,200,100,50,10);
	public void settings() {
		  size(400, 400);}
	public void setup() {
		stroke(0);
	  strokeWeight(20);
	  background(255);
	}
	public void draw() {
	}
	public void keyPressed() {
	  for(int i=0;i<10;i++) if(key==(i+"").charAt(0)){background(255);
	  double outp[]={0,0,0,0,0,0,0,0,0,0};
	  outp[i]=1;
	  double getpixel[]=new double[400];
	  for(int x=0;x<20;x++) for(int j=0;j<20;j++) getpixel[x+20*j]=blue(get(x*20,j*20))/255; 
	  data.add(getpixel,outp);
	  
	  }
	  if(key=='l') network.learn(data);
	}
	public void mouseDragged() {point(mouseX,mouseY);
	}
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		PApplet.main("MainClass");
	}

}

```
