// File: /workspace/github_c_makefile_star2_O0/xtanitfy[P]Murphy/examples/mnist/mnist_train.c
// Function: main
int main(void)
{
	int ret = -1;

	/*��ȡ��������*/
	SIZE_s trainXSize;
	ret = Mnist_GetData(TRAIN_X_FILE,&gTrainX,&trainXSize);
	CHECK_EXPR_RET(ret,-1);
	
	SIZE_s trainYSize;
	ret = Mnist_GetData(TRAIN_Y_FILE,&gTrainY,&trainYSize);
	CHECK_EXPR_RET(ret,-1);

	SIZE_s testXSize;
	ret = Mnist_GetData(TEST_X_FILE,&gTestX,&testXSize);
	CHECK_EXPR_RET(ret,-1);
	Mnist_PrintSize("testX",&testXSize);
	
	SIZE_s testYSize;
	ret = Mnist_GetData(TRAIN_Y_FILE,&gTestY,&testYSize);
	CHECK_EXPR_RET(ret,-1);
	Mnist_PrintSize("testY",&testYSize);
	
	//Mnist_dataNormalie(gTrainX,&trainXSize);

#if 0
	/*��ʼ��������*/
	OPTS_s opts;
	opts.alpha = 1;
	opts.batchsize = 50;
	opts.numepochs = 1;
	opts.channels = 1;//sizeof(double);
	opts.loss_function = functionLoss1;
	opts.classifyNum = 10;
	ret = NET_init(&opts);
	CHECK_EXPR_RET(ret != 0,ret);
#else
	
	netTrainPara.alpha = 1;
	netTrainPara.batchsize = 50;
	netTrainPara.numepochs = 1;
	netTrainPara.channels = 1;//sizeof(double);
	netTrainPara.loss_function = functionLoss1;
	netTrainPara.classifyNum = 10;
	pNetTrain = NET_create(&netTrainPara);
#endif


	MnistBuildTrainNet(netTrainPara.batchsize,trainXSize.h,trainXSize.w);

	MnistTrainRun(&trainXSize,&trainYSize);


	/*������Ҫ���¹����������磬��Ϊbatches�����˱仯*/
#if 0
	OPTS_s *pOPts = NET_GetOpts();
	pOPts->batchsize = testXSize.n;
	CHECK_EXPR_RET(inputPara.hSize != testXSize.h,-1);
	CHECK_EXPR_RET(inputPara.wSize != testXSize.w,-1);
	
	int testXAllSize = pOPts->batchsize * testXSize.h * testXSize.w;
	NET_setInputData(gTestX,testXAllSize);

	int testYAllSize = pOPts->batchsize * testYSize.h * testYSize.w;
	NET_setTableYData(gTestY,testYAllSize);

	ret = NET_test();
	CHECK_EXPR_RET(ret != 0,-1);
#endif
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movl $0x0, -0x4(%rbp)
movl $0xffffffff, -0x8(%rbp) # imm = 0xFFFFFFFF
leaq 0x9633(%rip), %rdi      # 0xb0c0
leaq 0xca64(%rip), %rsi      # 0xe4f8
leaq -0x18(%rbp), %rdx
callq 0x1ce0
movl %eax, -0x8(%rbp)
cmpl $0x0, -0x8(%rbp)
je 0x1ad3
leaq 0x9568(%rip), %rdi      # 0xb015
leaq 0x9577(%rip), %rsi      # 0xb02b
leaq 0x9627(%rip), %rdx      # 0xb0e2
movl $0x10c, %ecx            # imm = 0x10C
movb $0x0, %al
callq 0x1030
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x1c58
leaq 0x960d(%rip), %rdi      # 0xb0e7
leaq 0xca1f(%rip), %rsi      # 0xe500
leaq -0x28(%rbp), %rdx
callq 0x1ce0
movl %eax, -0x8(%rbp)
cmpl $0x0, -0x8(%rbp)
je 0x1b20
leaq 0x951b(%rip), %rdi      # 0xb015
leaq 0x952a(%rip), %rsi      # 0xb02b
leaq 0x95da(%rip), %rdx      # 0xb0e2
movl $0x110, %ecx            # imm = 0x110
movb $0x0, %al
callq 0x1030
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x1c58
leaq 0x95e1(%rip), %rdi      # 0xb108
leaq 0xc9da(%rip), %rsi      # 0xe508
leaq -0x38(%rbp), %rdx
callq 0x1ce0
movl %eax, -0x8(%rbp)
cmpl $0x0, -0x8(%rbp)
je 0x1b6d
leaq 0x94ce(%rip), %rdi      # 0xb015
leaq 0x94dd(%rip), %rsi      # 0xb02b
leaq 0x958d(%rip), %rdx      # 0xb0e2
movl $0x114, %ecx            # imm = 0x114
movb $0x0, %al
callq 0x1030
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x1c58
leaq 0x95b4(%rip), %rdi      # 0xb128
leaq -0x38(%rbp), %rsi
callq 0x1c70
leaq 0x9563(%rip), %rdi      # 0xb0e7
leaq 0xc985(%rip), %rsi      # 0xe510
leaq -0x48(%rbp), %rdx
callq 0x1ce0
movl %eax, -0x8(%rbp)
cmpl $0x0, -0x8(%rbp)
je 0x1bca
leaq 0x9471(%rip), %rdi      # 0xb015
leaq 0x9480(%rip), %rsi      # 0xb02b
leaq 0x9530(%rip), %rdx      # 0xb0e2
movl $0x119, %ecx            # imm = 0x119
movb $0x0, %al
callq 0x1030
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x1c58
leaq 0x955d(%rip), %rdi      # 0xb12e
leaq -0x48(%rbp), %rsi
callq 0x1c70
movsd 0x9426(%rip), %xmm0     # 0xb008
movsd %xmm0, 0xc8e6(%rip)     # 0xe4d0
movl $0x32, 0xc8e4(%rip)     # 0xe4d8
movl $0x1, 0xc8de(%rip)      # 0xe4dc
movl $0x1, 0xc8d8(%rip)      # 0xe4e0
leaq 0x1831(%rip), %rax      # 0x3440
movq %rax, 0xc8d2(%rip)      # 0xe4e8
movl $0xa, 0xc8c4(%rip)      # 0xe4e4
leaq 0xc6a1(%rip), %rdi      # 0xe2c8
callq 0x3c70
movq %rax, 0xc68d(%rip)      # 0xe2c0
movl 0xc89f(%rip), %edi      # 0xe4d8
movl -0x18(%rbp), %esi
movl -0x14(%rbp), %edx
callq 0x1270
leaq -0x18(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x1890
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)