// File: btbujiangjun[P]abcdl/src/cnn/Layer.cpp
// Function: abcdl::cnn::OutputLayer::initialize(abcdl::cnn::Layer*)
void OutputLayer::initialize(Layer* pre_layer){
    this->_cols = pre_layer->get_rows() * pre_layer->get_cols() * pre_layer->get_out_channel_size();
    this->_in_channel_size = pre_layer->get_out_channel_size();

    this->_weights.push_back(new abcdl::algebra::RandomMatrix<real>(this->_rows, this->_cols, 0.0, 0.5));
    this->_bias = new abcdl::algebra::Mat(0.0, _rows, 1);
    this->_activations.push_back(new abcdl::algebra::Mat());
    this->_deltas.push_back(new abcdl::algebra::Mat());

    this->_delta_weights.push_back(new abcdl::algebra::Mat(this->_rows, this->_cols));
    this->_delta_bias = new abcdl::algebra::Mat(0.0, _rows, 1);
    this->_batch_weights.push_back(new abcdl::algebra::Mat(this->_rows, this->_cols));
    this->_batch_bias = new abcdl::algebra::Mat(0.0, _rows, 1);
}

// Assembly:
subq $0xf8, %rsp
movq %rdi, 0xf0(%rsp)
movq %rsi, 0xe8(%rsp)
movq 0xf0(%rsp), %rax
movq %rax, 0x80(%rsp)
movq 0xe8(%rsp), %rdi
callq 0x29930
movq %rax, 0x68(%rsp)
movq 0xe8(%rsp), %rdi
callq 0x29940
movq %rax, %rcx
movq 0x68(%rsp), %rax
imulq %rcx, %rax
movq %rax, 0x70(%rsp)
movq 0xe8(%rsp), %rdi
callq 0x29980
movq 0x70(%rsp), %rcx
movq %rax, %rdx
movq 0x80(%rsp), %rax
imulq %rdx, %rcx
movq %rcx, 0x10(%rax)
movq 0xe8(%rsp), %rdi
callq 0x29980
movq %rax, %rcx
movq 0x80(%rsp), %rax
movq %rcx, 0x18(%rax)
addq $0x40, %rax
movq %rax, 0x78(%rsp)
movl $0x38, %edi
callq 0x93a0
movq %rax, %rdi
movq 0x80(%rsp), %rax
movq %rdi, %rcx
movq %rcx, 0x88(%rsp)
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
movl $0x0, 0xdc(%rsp)
movl $0x3f000000, 0xd8(%rsp) # imm = 0x3F000000
movl $0x0, 0xd4(%rsp)
movl $0x0, 0xd0(%rsp)
movq %rsp, %rax
leaq 0xd0(%rsp), %rcx
movq %rcx, (%rax)
leaq 0xdc(%rsp), %rcx
leaq 0xd8(%rsp), %r8
leaq 0xd4(%rsp), %r9
callq 0x36e00
jmp 0x28ea2
movq 0x78(%rsp), %rdi
movq 0x88(%rsp), %rax
movq %rax, 0xe0(%rsp)
leaq 0xe0(%rsp), %rsi
callq 0x2a090
movl $0x28, %edi
callq 0x93a0
movq %rax, %rdi
movq 0x80(%rsp), %rax
movq %rdi, %rcx
movq %rcx, 0x60(%rsp)
movl $0x0, 0xc0(%rsp)
movq 0x8(%rax), %rdx
leaq 0xc0(%rsp), %rsi
movl $0x1, %ecx
callq 0x305d0
jmp 0x28f04
movq 0x80(%rsp), %rax
movq 0x60(%rsp), %rcx
movq %rcx, 0x58(%rax)
addq $0x60, %rax
movq %rax, 0x50(%rsp)
movl $0x28, %edi
callq 0x93a0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x58(%rsp)
callq 0x30500
jmp 0x28f3a
movq 0x50(%rsp), %rdi
movq 0x58(%rsp), %rax
movq %rax, 0xb8(%rsp)
leaq 0xb8(%rsp), %rsi
callq 0x178b0
movq 0x80(%rsp), %rax
addq $0xb8, %rax
movq %rax, 0x40(%rsp)
movl $0x28, %edi
callq 0x93a0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x48(%rsp)
callq 0x30500
jmp 0x28f88
movq 0x40(%rsp), %rdi
movq 0x48(%rsp), %rax
movq %rax, 0xb0(%rsp)
leaq 0xb0(%rsp), %rsi
callq 0x178b0
movq 0x80(%rsp), %rax
addq $0x78, %rax
movq %rax, 0x30(%rsp)
movl $0x28, %edi
callq 0x93a0
movq %rax, %rdi
movq 0x80(%rsp), %rax
movq %rdi, %rcx
movq %rcx, 0x38(%rsp)
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
callq 0x30540
jmp 0x28fe4
movq 0x30(%rsp), %rdi
movq 0x38(%rsp), %rax
movq %rax, 0xa8(%rsp)
leaq 0xa8(%rsp), %rsi
callq 0x178b0
movl $0x28, %edi
callq 0x93a0
movq %rax, %rdi
movq 0x80(%rsp), %rax
movq %rdi, %rcx
movq %rcx, 0x28(%rsp)
movl $0x0, 0xa4(%rsp)
movq 0x8(%rax), %rdx
leaq 0xa4(%rsp), %rsi
movl $0x1, %ecx
callq 0x305d0
jmp 0x29043
movq 0x80(%rsp), %rax
movq 0x28(%rsp), %rcx
movq %rcx, 0x90(%rax)
addq $0x98, %rax
movq %rax, 0x18(%rsp)
movl $0x28, %edi
callq 0x93a0
movq %rax, %rdi
movq 0x80(%rsp), %rax
movq %rdi, %rcx
movq %rcx, 0x20(%rsp)
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
callq 0x30540
jmp 0x2908e
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rax
movq %rax, 0x98(%rsp)
leaq 0x98(%rsp), %rsi
callq 0x178b0
movl $0x28, %edi
callq 0x93a0
movq %rax, %rdi
movq 0x80(%rsp), %rax
movq %rdi, %rcx
movq %rcx, 0x10(%rsp)
movl $0x0, 0x94(%rsp)
movq 0x8(%rax), %rdx
leaq 0x94(%rsp), %rsi
movl $0x1, %ecx
callq 0x305d0
jmp 0x290ed
movq 0x80(%rsp), %rax
movq 0x10(%rsp), %rcx
movq %rcx, 0xb0(%rax)
addq $0xf8, %rsp
retq
movq 0x88(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc8(%rsp)
movl %eax, 0xc4(%rsp)
callq 0x9380
jmp 0x29213
movq 0x60(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc8(%rsp)
movl %eax, 0xc4(%rsp)
callq 0x9380
jmp 0x29213
movq 0x58(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc8(%rsp)
movl %eax, 0xc4(%rsp)
callq 0x9380
jmp 0x29213
movq 0x48(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc8(%rsp)
movl %eax, 0xc4(%rsp)
callq 0x9380
jmp 0x29213
movq 0x38(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc8(%rsp)
movl %eax, 0xc4(%rsp)
callq 0x9380
jmp 0x29213
movq 0x28(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc8(%rsp)
movl %eax, 0xc4(%rsp)
callq 0x9380
jmp 0x29213
movq 0x20(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc8(%rsp)
movl %eax, 0xc4(%rsp)
callq 0x9380
jmp 0x29213
movq 0x10(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc8(%rsp)
movl %eax, 0xc4(%rsp)
callq 0x9380
movq 0xc8(%rsp), %rdi
callq 0x95d0