 #include <cublas_v2.h>
 
 const static float dt = 1.0E-01f;
-const static float threshold = 1.3E-01f;
+const static float threshold = 1.0E-02f;
 
 struct Layer {
 	float *output;

	l_input.clear();
	l_c1.clear();
	l_s1.clear();
	l_c2.clear();
	l_s2.clear();
	l_f.clear();

	l_input.setOutput((float *)input);
	
	PREACT_C(5, 6, 24, 1, l_input.output, l_c1.preact, l_c1.weight);
	BIAS_C(6, 24, l_c1.preact, l_c1.bias);
	apply_step_function<<<64, 64>>>(l_c1.preact, l_c1.output, l_c1.O);

	PREACT_S(2, 6, 12, l_c1.output, l_s1.preact, l_s1.weight);
	BIAS_S(6, 6, l_s1.preact, l_s1.bias);
	apply_step_function<<<64, 64>>>(l_s1.preact, l_s1.output, l_s1.O);
	
	PREACT_C(5, 6, 8, 6, l_s1.output, l_c2.preact, l_c2.weight);
	BIAS_C(36, 8, l_c2.preact, l_c2.bias);
	apply_step_function<<<64, 64>>>(l_c2.preact, l_c2.output, l_c2.O);

	PREACT_S(2, 6*6, 4, l_c2.output, l_s2.preact, l_s2.weight);
	BIAS_S(36, 4, l_s2.preact, l_s2.bias);
	apply_step_function<<<64, 64>>>(l_s2.preact, l_s2.output, l_s2.O);

	preact_f<<<64, 64>>>((float (*)[4][4])l_s2.output, l_f.preact, (float (*)[36][4][4])l_f.weight);
	bias_f<<<64, 64>>>(l_f.preact, l_f.bias);
	apply_step_function<<<64, 64>>>(l_f.preact, l_f.output, l_f.O);
}

			l_f.bp_clear();
			l_s1.bp_clear();
			l_c1.bp_clear();

			makeError<<<10, 1>>>(l_f.d_preact, l_f.output, train_set[i].label, 10);

			bp_weight_f<<<64, 64>>>((float (*)[6][6][6])l_f.d_weight, l_f.d_preact, (float (*)[6][6])l_s1.output);
			bp_bias_f<<<64, 64>>>(l_f.bias, l_f.d_preact);

			bp_output_s1<<<64, 64>>>((float (*)[6][6])l_s1.d_output, (float (*)[6][6][6])l_f.weight, l_f.d_preact);
			bp_preact_s1<<<64, 64>>>((float (*)[6][6])l_s1.d_preact, (float (*)[6][6])l_s1.d_output, (float (*)[6][6])l_s1.preact);
			bp_weight_s1<<<64, 64>>>((float (*)[4][4])l_s1.d_weight, (float (*)[6][6])l_s1.d_preact, (float (*)[24][24])l_c1.output);
			bp_bias_s1<<<64, 64>>>(l_s1.bias, (float (*)[6][6])l_s1.d_preact);

			bp_output_c1<<<64, 64>>>((float (*)[24][24])l_c1.d_output, (float (*)[4][4])l_s1.weight, (float (*)[6][6])l_s1.d_preact);
			bp_preact_c1<<<64, 64>>>((float (*)[24][24])l_c1.d_preact, (float (*)[24][24])l_c1.d_output, (float (*)[24][24])l_c1.preact);
			bp_weight_c1<<<64, 64>>>((float (*)[5][5])l_c1.d_weight, (float (*)[24][24])l_c1.d_preact, (float (*)[28])l_input.output);
			bp_bias_c1<<<64, 64>>>(l_c1.bias, (float (*)[24][24])l_c1.d_preact);


			apply_grad<<<64, 64>>>(l_f.weight, l_f.d_weight, l_f.M * l_f.N);
			apply_grad<<<64, 64>>>(l_s1.weight, l_s1.d_weight, l_s1.M * l_s1.N);
			apply_grad<<<64, 64>>>(l_c1.weight, l_c1.d_weight, l_c1.M * l_c1.N);
		}
