示例#1
0
 def __init__(self):
     super().__init__()
     MUS = [-0.9, -0.7, -0.5, -0.3, -0.1, 0.1, 0.3, 0.5, 0.7, 0.9, 1.0]
     SIGMAS = [0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.001]
     self.bert_ranker = VanillaBertRanker()
     self.simmat = modeling_util.SimmatModule()
     self.kernels = modeling_util.KNRMRbfKernelBank(MUS, SIGMAS)
     self.combine = torch.nn.Linear(self.kernels.count() * self.CHANNELS + self.BERT_SIZE, 1)
示例#2
0
 def __init__(self):
     super().__init__()
     ## KNRM
     MUS = [-0.9, -0.7, -0.5, -0.3, -0.1, 0.1, 0.3, 0.5, 0.7, 0.9, 1.0]
     SIGMAS = [0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.001]
     self.kernels = modeling_util.KNRMRbfKernelBank(MUS, SIGMAS)
     #self.batchnorm = torch.nn.BatchNorm1d(self.kernels.count()*self.CHANNELS)
     self.combine = torch.nn.Linear(self.kernels.count() * self.CHANNELS, 1)
     #self.dropout_two = torch.nn.Dropout(0.1).to('cuda:0')
     self.simmat = modeling_util.SimmatModule()
示例#3
0
    def __init__(self, config_path):
        super().__init__(config_path)

        # MUS,SIGMAS = modeling_util.init_kernels(21)

        MUS = [-0.9, -0.7, -0.5, -0.3, -0.1, 0.1, 0.3, 0.5, 0.7, 0.9, 1.0]
        SIGMAS = [0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.001]

        self.simmat = modeling_util.SimmatModule()
        self.kernels = modeling_util.KNRMRbfKernelBank(MUS, SIGMAS)
        self.combine = torch.nn.Linear(self.kernels.count(), 1)  #
示例#4
0
 def __init__(self,QLEN):
     super().__init__(QLEN)
     
     MUS,SIGMAS = modeling_util.init_kernels(21)
     
     #MUS = [-0.9, -0.7, -0.5, -0.3, -0.1, 0.1, 0.3, 0.5, 0.7, 0.9, 1.0]
     #SIGMAS = [0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.001]
     # self.bert_ranker = VanillaBertRanker()
     self.simmat = modeling_util.SimmatModule()
     self.kernels = modeling_util.KNRMRbfKernelBank(MUS, SIGMAS)
     self.combine = torch.nn.Linear(self.kernels.count() * self.CHANNELS, 1)