// File: xbai0624[P]dnn/src/Network.cpp
// Function: Network::Classify()
std::vector<Matrix> Network::Classify()
{
    std::vector<Matrix> res;
    ConstructLayers(TrainingType::ResumeTraining);

    __numberOfEpoch = 1; // test QQQQQQQQQQQQQQQQQQQQQQQQQQQQ
    for(int i=0;i<__numberOfEpoch;i++)
    {
        std::cout<<"[------]Number of epoch: "<<i<<"/"<<__numberOfEpoch<<endl;
        UpdateEpoch();
    }

    // check accuracy 
    cout<<"accuracy: "<<endl;
    std::vector<double> & accuracy = __outputLayer->GetAccuracyForBatches();
    for(auto &i: accuracy)
        cout<<i<<",   "<<endl;

    // check cost 
    cout<<"cost: "<<endl;
    std::vector<double> &cost = __outputLayer->GetCostForBatches();
    for(auto &i: cost)
        cout<<i<<", "<<endl;

    return res;
}

// Assembly:
subq $0xf8, %rsp
movq %rdi, 0x68(%rsp)
movq %rdi, %rax
movq %rax, 0x70(%rsp)
movq %rdi, 0xf0(%rsp)
movq %rsi, 0xe8(%rsp)
movq 0xe8(%rsp), %rax
movq %rax, 0x78(%rsp)
movb $0x0, 0xe7(%rsp)
callq 0x1f050
movq 0x78(%rsp), %rdi
movl $0x1, %esi
callq 0x452d0
jmp 0x4645f
movq 0x78(%rsp), %rax
movl $0x1, 0x30(%rax)
movl $0x0, 0xd0(%rsp)
movq 0x78(%rsp), %rcx
movl 0xd0(%rsp), %eax
cmpl 0x30(%rcx), %eax
jge 0x46548
movq 0x24b46(%rip), %rdi     # 0x6afd8
leaq 0xf44b(%rip), %rsi      # 0x558e4
callq 0x4230
movq %rax, 0x60(%rsp)
jmp 0x464a5
movq 0x60(%rsp), %rdi
movl 0xd0(%rsp), %esi
callq 0x43e0
movq %rax, 0x58(%rsp)
jmp 0x464bd
movq 0x58(%rsp), %rdi
leaq 0xf435(%rip), %rsi      # 0x558fe
callq 0x4230
movq %rax, 0x50(%rsp)
jmp 0x464d5
movq 0x50(%rsp), %rdi
movq 0x78(%rsp), %rax
movl 0x30(%rax), %esi
callq 0x43e0
movq %rax, 0x48(%rsp)
jmp 0x464ee
movq 0x48(%rsp), %rdi
movq 0x24ab6(%rip), %rsi     # 0x6afb0
callq 0x4260
jmp 0x46501
movq 0x78(%rsp), %rdi
callq 0x45ff0
jmp 0x4650d
jmp 0x4650f
movl 0xd0(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xd0(%rsp)
jmp 0x46476
movq 0x68(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xd8(%rsp)
movl %eax, 0xd4(%rsp)
callq 0x1f0d0
jmp 0x467ad
movq 0x24a89(%rip), %rdi     # 0x6afd8
leaq 0xf3aa(%rip), %rsi      # 0x55900
callq 0x4230
movq %rax, 0x40(%rsp)
jmp 0x46562
movq 0x40(%rsp), %rdi
movq 0x24a42(%rip), %rsi     # 0x6afb0
callq 0x4260
jmp 0x46575
movq 0x78(%rsp), %rax
movq 0x20(%rax), %rdi
movq (%rdi), %rax
movq 0x2d8(%rax), %rax
callq *%rax
movq %rax, 0x38(%rsp)
jmp 0x46591
movq 0x38(%rsp), %rax
movq %rax, 0xc8(%rsp)
movq 0xc8(%rsp), %rax
movq %rax, 0xc0(%rsp)
movq 0xc0(%rsp), %rdi
callq 0x21d50
movq %rax, 0xb8(%rsp)
movq 0xc0(%rsp), %rdi
callq 0x21d80
movq %rax, 0xb0(%rsp)
leaq 0xb8(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0x21db0
testb $0x1, %al
jne 0x465f3
jmp 0x46666
leaq 0xb8(%rsp), %rdi
callq 0x21df0
movq %rax, 0xa8(%rsp)
movq 0xa8(%rsp), %rax
movsd (%rax), %xmm0
movq 0x249bd(%rip), %rdi     # 0x6afd8
callq 0x4440
movq %rax, 0x30(%rsp)
jmp 0x46627
movq 0x30(%rsp), %rdi
leaq 0xf2d8(%rip), %rsi      # 0x5590b
callq 0x4230
movq %rax, 0x28(%rsp)
jmp 0x4663f
movq 0x28(%rsp), %rdi
movq 0x24965(%rip), %rsi     # 0x6afb0
callq 0x4260
jmp 0x46652
jmp 0x46654
leaq 0xb8(%rsp), %rdi
callq 0x21e00
jmp 0x465d8
movq 0x2496b(%rip), %rdi     # 0x6afd8
leaq 0xf2f6(%rip), %rsi      # 0x5596a
callq 0x4230
movq %rax, 0x20(%rsp)
jmp 0x46680
movq 0x20(%rsp), %rdi
movq 0x24924(%rip), %rsi     # 0x6afb0
callq 0x4260
jmp 0x46693
movq 0x78(%rsp), %rax
movq 0x20(%rax), %rdi
movq (%rdi), %rax
movq 0x2e0(%rax), %rax
callq *%rax
movq %rax, 0x18(%rsp)
jmp 0x466af
movq 0x18(%rsp), %rax
movq %rax, 0xa0(%rsp)
movq 0xa0(%rsp), %rax
movq %rax, 0x98(%rsp)
movq 0x98(%rsp), %rdi
callq 0x21d50
movq %rax, 0x90(%rsp)
movq 0x98(%rsp), %rdi
callq 0x21d80
movq %rax, 0x88(%rsp)
leaq 0x90(%rsp), %rdi
leaq 0x88(%rsp), %rsi
callq 0x21db0
testb $0x1, %al
jne 0x46711
jmp 0x46784
leaq 0x90(%rsp), %rdi
callq 0x21df0
movq %rax, 0x80(%rsp)
movq 0x80(%rsp), %rax
movsd (%rax), %xmm0
movq 0x2489f(%rip), %rdi     # 0x6afd8
callq 0x4440
movq %rax, 0x10(%rsp)
jmp 0x46745
movq 0x10(%rsp), %rdi
leaq 0xf681(%rip), %rsi      # 0x55dd2
callq 0x4230
movq %rax, 0x8(%rsp)
jmp 0x4675d
movq 0x8(%rsp), %rdi
movq 0x24847(%rip), %rsi     # 0x6afb0
callq 0x4260
jmp 0x46770
jmp 0x46772
leaq 0x90(%rsp), %rdi
callq 0x21e00
jmp 0x466f6
movb $0x1, 0xe7(%rsp)
testb $0x1, 0xe7(%rsp)
jne 0x467a0
movq 0x68(%rsp), %rdi
callq 0x1f0d0
movq 0x70(%rsp), %rax
addq $0xf8, %rsp
retq
movq 0xd8(%rsp), %rdi
callq 0x43f0
nopw (%rax,%rax)