Exemplo n.º 1
0
Arquivo: bid.py Projeto: HMMBRB/brb-1
 def __init__(self, rule_num, base_num, base_rule_num, att_dim, mid_dim, res_dim):
     super(AModel, self).__init__()
     self.bms = [BModel(base_rule_num, att_dim, mid_dim) for _ in range(base_num)]
     self.a = generate_variable((rule_num, base_num, mid_dim,))
     self.d = generate_variable((base_num,))
     self.b = generate_variable((rule_num, res_dim,))
     self.r = generate_variable((rule_num,))
Exemplo n.º 2
0
Arquivo: pre.py Projeto: HMMBRB/brb-1
 def __init__(self,
              rule_num,
              att_dim,
              low,
              high,
              cat_dims,
              res_dim,
              junc,
              name=None):
     super(BaseM, self).__init__(name=name)
     self.an = generate_variable(
         (rule_num, att_dim),
         initial_value=np.random.uniform(low, high, (
             rule_num,
             att_dim,
         )))
     self.o = generate_variable((att_dim, ),
                                initial_value=0.5 * (high - low))
     self.dz = tf.constant(0.01 * (high - low))
     self.ac = [
         generate_variable((
             rule_num,
             cat_dim,
         )) for cat_dim in cat_dims
     ]
     self.b = generate_variable((
         rule_num,
         res_dim,
     ))
     self.r = generate_variable((rule_num, ))
     self.j = generate_junctive(junc)
     self.tv = self.trainable_variables
Exemplo n.º 3
0
 def __init__(self, rule_num, att_dim, sub_dim, res_dim):
     super(Modelz, self).__init__()
     self.a = generate_variable((rule_num, att_dim,))
     self.d = generate_variable((att_dim,))
     self.b = generate_variable((rule_num, res_dim,))
     self.r = generate_variable((rule_num,))
     # self.s = generate_variable((rule_num, sub_dim,))
     self.s = tf.Variable(tf.random.normal((rule_num, sub_dim,), 0.5, dtype=tf.float64))
     self.z = generate_variable((res_dim,))
Exemplo n.º 4
0
Arquivo: pre.py Projeto: HMMBRB/brb-1
 def __init__(self, rule_num, dis_num, dis_dim, res_dim, junc, name=None):
     super(Dist, self).__init__(name=name)
     self.a = generate_variable((
         rule_num,
         dis_num,
         dis_dim,
     ))
     self.b = generate_variable((rule_num, res_dim))
     self.r = generate_variable((rule_num, ))
     self.j = generate_junctive(junc)
Exemplo n.º 5
0
Arquivo: pre.py Projeto: HMMBRB/brb-1
 def __init__(self, rule_num, cat_dims, res_dim, junc, name=None):
     super(BaseC, self).__init__(name=name)
     self.a = [
         generate_variable((rule_num, cat_dim)) for cat_dim in cat_dims
     ]
     self.b = generate_variable((
         rule_num,
         res_dim,
     ))
     self.r = generate_variable((rule_num, ))
     self.j = generate_junctive(junc)
     self.tv = self.trainable_variables
Exemplo n.º 6
0
Arquivo: bid.py Projeto: HMMBRB/brb-1
 def __init__(self, rule_num, att_dim, res_dim):
     super(BModel, self).__init__()
     self.a = generate_variable((rule_num, att_dim,))
     self.d = generate_variable((att_dim,))
     self.b = generate_variable((rule_num, res_dim,))
     self.r = generate_variable((rule_num,))