implemented @f0k suggestions, simplified code a bit
implemented @f0k suggestions, simplified code a bit

DataFighter/Lasagne-tutorial,MihailoIsakov/fishfish,dnuffer/Lasagne,ErnstHowie/Lasagne,takacsg84/Lasagne,DeanChan/Lasagne,kracwarlock/Lasagne,rlkelly/Lasagne,ebattenberg/Lasagne,Richi91/nntools,mheilman/Lasagne,cancan101/Lasagne,gabortakacs/Lasagne