def __init__(self, output_size, input_size=None, ignore_bias=False, initializer=GlorotNormal(),
              weight_decay=0):
     self._size_o = output_size
     self._initializer = initializer
     self._ignore_bias = ignore_bias
     self._weight_decay = weight_decay
     super(Gru, self).__init__(input_size)
Ejemplo n.º 2
0
 def __init__(self,
              output_size,
              input_size=None,
              initializer=GlorotNormal()):
     self._output_size = output_size
     self._initializer = initializer
     super(Weighted_test_model, self).__init__(input_size)
Ejemplo n.º 3
0
 def __init__(self,
              output_size,
              input_size=None,
              initializer=GlorotNormal()):
     self._size_o = output_size
     self._initializer = initializer
     super(PeepholeLstm, self).__init__(input_size)
Ejemplo n.º 4
0
 def __init__(self,
              output_size,
              input_size=None,
              initializer=GlorotNormal()):
     self._output_size = output_size
     self._initializer = initializer
     super(Embedding, self).__init__(input_size)
Ejemplo n.º 5
0
 def __init__(self,
              channel=32,
              filter=3,
              padding=0,
              stride=1,
              input_size=None,
              initializer=GlorotNormal()):
     self._padding, self._stride, self._kernel = (tuplize(x)
                                                  for x in (padding, stride,
                                                            filter))
     self._channel = channel
     self._initializer = initializer
     super(Conv2d, self).__init__(input_size)
Ejemplo n.º 6
0
 def __init__(self,
              input_size=None,
              momentum=0.99,
              mode="activation",
              epsilon=1e-5,
              initializer=GlorotNormal()):
     self._mov_mean = 0
     self._mov_std = 0
     self._epsilon = epsilon
     self._momentum = momentum
     self._mode = mode_dict.get(mode, BATCH_NORMALIZE_ELEMENTWISE)
     self.inference = False
     self._initializer = initializer
     super(BatchNormalize, self).__init__(input_size)
 def __init__(self,
              channel=32,
              filter=3,
              padding=0,
              stride=1,
              dilation=1,
              input_size=None,
              ignore_bias=False,
              initializer=GlorotNormal(),
              weight_decay=0):
     self._padding, self._stride, self._kernel, self._dilation = (
         tuplize(x) for x in (padding, stride, filter, dilation))
     self._channel = channel
     self._ignore_bias = ignore_bias
     self._initializer = initializer
     self._weight_decay = weight_decay
     super(Conv2d, self).__init__(input_size)
Ejemplo n.º 8
0
    def __init__(self,
                 input_size=None,
                 momentum=0.99,
                 mode="activation",
                 epsilon=1e-5,
                 ignore_bias=False,
                 initializer=GlorotNormal(),
                 weight_decay=0):

        assert momentum > 0, "The value of momentum must be lager than 0."
        self._mov_mean = 0
        self._mov_std = 0
        self._epsilon = epsilon
        self._momentum = momentum
        self._mode = mode_dict.get(mode, BATCH_NORMALIZE_ELEMENTWISE)
        self.inference = False
        self._ignore_bias = ignore_bias
        self._initializer = initializer
        self._weight_decay = weight_decay
        super(BatchNormalize, self).__init__(input_size)
Ejemplo n.º 9
0
 def __init__(self,
              channel=32,
              filter=3,
              padding=0,
              stride=1,
              dilation=1,
              groups=1,
              input_size=None,
              ignore_bias=False,
              initializer=GlorotNormal(),
              weight_decay=0):
     self._padding, self._stride, self._kernel, self._dilation = (
         tuplize(x) for x in (padding, stride, filter, dilation))
     self._channel = channel
     self._groups = groups
     #print("self._groups: ", self._groups)
     assert isinstance(
         self._groups, int
     ) and self._groups > 0, "Please set groups to integer greater than 0"
     self._ignore_bias = ignore_bias
     self._initializer = initializer
     self._weight_decay = weight_decay
     super(GroupConv2d, self).__init__(input_size)
Ejemplo n.º 10
0
 def __init__(self, output_size, initializer=GlorotNormal()):
     self._size_o = output_size
     self._initializer = initializer
Ejemplo n.º 11
0
 def __init__(self, output_size, input_size, initializer=GlorotNormal(), weight_decay=None):
     self._output_size = output_size
     self._initializer = initializer
     self._weight_decay = weight_decay
     super(Embedding, self).__init__(input_size)