// File: IdelCoder[P]PTransE-ag/Train_PTransE-pos.cpp
// Function: Train::train_path(int, int, std::vector<int, std::allocator<int>>, double, double)
void train_path(int rel, int rel_neg, vector<int> rel_path, double margin,double x)
    {
        double sum1 = calc_path(rel,rel_path);
        double sum2 = calc_path(rel_neg,rel_path);
		double lambda = 1;
        if (sum1+margin>sum2)
        {
            // 训练path
            // 记录误差
        	res+=x*lambda*(margin+sum1-sum2);
        	gradient_path(rel,rel_path, -x*lambda);
			gradient_path(rel_neg,rel_path, x*lambda);
        }
    }

// Assembly:
subq $0x118, %rsp            # imm = 0x118
movq %rcx, 0x38(%rsp)
movl %esi, %eax
movq 0x38(%rsp), %rsi
movq %rsi, 0x40(%rsp)
movq %rdi, 0x110(%rsp)
movl %eax, 0x10c(%rsp)
movl %edx, 0x108(%rsp)
movq %rsi, 0x100(%rsp)
movsd %xmm0, 0xf8(%rsp)
movsd %xmm1, 0xf0(%rsp)
movq 0x110(%rsp), %rax
movq %rax, 0x48(%rsp)
movl 0x10c(%rsp), %eax
movl %eax, 0x54(%rsp)
leaq 0xd0(%rsp), %rdi
movq %rdi, 0x58(%rsp)
callq 0x8350
movq 0x48(%rsp), %rdi
movl 0x54(%rsp), %esi
movq 0x58(%rsp), %rdx
callq 0x13e60
movsd %xmm0, 0x60(%rsp)
jmp 0xf47d
leaq 0xd0(%rsp), %rdi
callq 0x5350
movsd 0x60(%rsp), %xmm0
movq 0x40(%rsp), %rsi
movsd %xmm0, 0xe8(%rsp)
movl 0x108(%rsp), %eax
movl %eax, 0x24(%rsp)
leaq 0xa0(%rsp), %rdi
movq %rdi, 0x28(%rsp)
callq 0x8350
movq 0x48(%rsp), %rdi
movl 0x24(%rsp), %esi
movq 0x28(%rsp), %rdx
callq 0x13e60
movsd %xmm0, 0x30(%rsp)
jmp 0xf4d6
leaq 0xa0(%rsp), %rdi
callq 0x5350
movsd 0x30(%rsp), %xmm0
movsd %xmm0, 0xb8(%rsp)
movsd 0xab26(%rip), %xmm0     # 0x1a020
movsd %xmm0, 0x98(%rsp)
movsd 0xe8(%rsp), %xmm0
addsd 0xf8(%rsp), %xmm0
ucomisd 0xb8(%rsp), %xmm0
jbe 0xf6bb
movq 0x48(%rsp), %rax
movq 0x40(%rsp), %rsi
movsd 0xf0(%rsp), %xmm0
movsd 0x98(%rsp), %xmm1
mulsd %xmm1, %xmm0
movsd 0xf8(%rsp), %xmm2
movsd 0xe8(%rsp), %xmm1
addsd %xmm1, %xmm2
movsd 0xb8(%rsp), %xmm1
subsd %xmm1, %xmm2
movsd 0x38(%rax), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x38(%rax)
movl 0x10c(%rsp), %eax
movl %eax, 0x14(%rsp)
leaq 0x80(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0x8350
movq 0x48(%rsp), %rdi
movl 0x14(%rsp), %esi
movq 0x18(%rsp), %rdx
movaps 0xaab5(%rip), %xmm1     # 0x1a060
movsd 0xf0(%rsp), %xmm0
pxor %xmm1, %xmm0
movsd 0x98(%rsp), %xmm1
mulsd %xmm1, %xmm0
callq 0x13fb0
jmp 0xf5cc
leaq 0x80(%rsp), %rdi
callq 0x5350
movq 0x40(%rsp), %rsi
movl 0x108(%rsp), %eax
movl %eax, 0x4(%rsp)
leaq 0x68(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0x8350
movq 0x48(%rsp), %rdi
movl 0x4(%rsp), %esi
movq 0x8(%rsp), %rdx
movsd 0xf0(%rsp), %xmm0
movsd 0x98(%rsp), %xmm1
mulsd %xmm1, %xmm0
callq 0x13fb0
jmp 0xf623
leaq 0x68(%rsp), %rdi
callq 0x5350
jmp 0xf6bb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc8(%rsp)
movl %eax, 0xc4(%rsp)
leaq 0xd0(%rsp), %rdi
callq 0x5350
jmp 0xf6c3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc8(%rsp)
movl %eax, 0xc4(%rsp)
leaq 0xa0(%rsp), %rdi
callq 0x5350
jmp 0xf6c3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc8(%rsp)
movl %eax, 0xc4(%rsp)
leaq 0x80(%rsp), %rdi
callq 0x5350
jmp 0xf6c3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc8(%rsp)
movl %eax, 0xc4(%rsp)
leaq 0x68(%rsp), %rdi
callq 0x5350
jmp 0xf6c3
addq $0x118, %rsp            # imm = 0x118
retq
movq 0xc8(%rsp), %rdi
callq 0x2370