#coding:utf8
import numpy as np
import torch as t
from torch import nn
from torch.autograd import Variable
from torch.nn import functional as F
from .basicmodule import BasicModule

class Model_M(BasicModule):
	def __init__(self,param):
		super(Model_M,self).__init__()
		self.param = param
		self.feature_dim = param.feature_dim
		self.object_num = param.object_num
		self.predicate_num = param.predicate_num
		self.batch_size = param.batch_size

		self.fc = nn.Linear(self.feature_dim,2961,bias=True)
		t.nn.init.xavier_uniform_(self.fc.weight, gain=1)
		t.nn.init.constant_(self.fc.bias, 0.0)

	def forward(self,f,keys):
		prob_s =Variable(t.from_numpy(f[:,:35])).cuda()
		prob_o = Variable(t.from_numpy(f[:,35:70])).cuda()
		inp_f = Variable(t.from_numpy(f)).cuda()
		p = self.fc(inp_f)
		if self.param.phase=='train':
			return p
		else:
			return p
cd65368ed0a838e4a03cd339606b3edcd760e079
<mask token>


class Model_M(BasicModule):
    <mask token>
    <mask token>

<mask token>


class Model_M(BasicModule):
    <mask token>

    def forward(self, f, keys):
        prob_s = Variable(t.from_numpy(f[:, :35])).cuda()
        prob_o = Variable(t.from_numpy(f[:, 35:70])).cuda()
        inp_f = Variable(t.from_numpy(f)).cuda()
        p = self.fc(inp_f)
        if self.param.phase == 'train':
            return p
        else:
            return p

<mask token>


class Model_M(BasicModule):

    def __init__(self, param):
        super(Model_M, self).__init__()
        self.param = param
        self.feature_dim = param.feature_dim
        self.object_num = param.object_num
        self.predicate_num = param.predicate_num
        self.batch_size = param.batch_size
        self.fc = nn.Linear(self.feature_dim, 2961, bias=True)
        t.nn.init.xavier_uniform_(self.fc.weight, gain=1)
        t.nn.init.constant_(self.fc.bias, 0.0)

    def forward(self, f, keys):
        prob_s = Variable(t.from_numpy(f[:, :35])).cuda()
        prob_o = Variable(t.from_numpy(f[:, 35:70])).cuda()
        inp_f = Variable(t.from_numpy(f)).cuda()
        p = self.fc(inp_f)
        if self.param.phase == 'train':
            return p
        else:
            return p

import numpy as np
import torch as t
from torch import nn
from torch.autograd import Variable
from torch.nn import functional as F
from .basicmodule import BasicModule


class Model_M(BasicModule):

    def __init__(self, param):
        super(Model_M, self).__init__()
        self.param = param
        self.feature_dim = param.feature_dim
        self.object_num = param.object_num
        self.predicate_num = param.predicate_num
        self.batch_size = param.batch_size
        self.fc = nn.Linear(self.feature_dim, 2961, bias=True)
        t.nn.init.xavier_uniform_(self.fc.weight, gain=1)
        t.nn.init.constant_(self.fc.bias, 0.0)

    def forward(self, f, keys):
        prob_s = Variable(t.from_numpy(f[:, :35])).cuda()
        prob_o = Variable(t.from_numpy(f[:, 35:70])).cuda()
        inp_f = Variable(t.from_numpy(f)).cuda()
        p = self.fc(inp_f)
        if self.param.phase == 'train':
            return p
        else:
            return p

#coding:utf8
import numpy as np
import torch as t
from torch import nn
from torch.autograd import Variable
from torch.nn import functional as F
from .basicmodule import BasicModule

class Model_M(BasicModule):
	def __init__(self,param):
		super(Model_M,self).__init__()
		self.param = param
		self.feature_dim = param.feature_dim
		self.object_num = param.object_num
		self.predicate_num = param.predicate_num
		self.batch_size = param.batch_size

		self.fc = nn.Linear(self.feature_dim,2961,bias=True)
		t.nn.init.xavier_uniform_(self.fc.weight, gain=1)
		t.nn.init.constant_(self.fc.bias, 0.0)

	def forward(self,f,keys):
		prob_s =Variable(t.from_numpy(f[:,:35])).cuda()
		prob_o = Variable(t.from_numpy(f[:,35:70])).cuda()
		inp_f = Variable(t.from_numpy(f)).cuda()
		p = self.fc(inp_f)
		if self.param.phase=='train':
			return p
		else:
			return p