Пример #1
0
    def connect(self, l_in):
        self.l_in = l_in
        self.n_in = l_in.size

        self.w = self.init((self.n_in, self.size),
                           fan_in=self.n_in,
                           name=self._name_param("w"))
        self.b = inits.const((self.size, ),
                             val=0.1,
                             name=self._name_param("b"))
        self.params = [self.w, self.b]
Пример #2
0
    def connect(self, l_in):
        self.l_in = l_in
        self.n_in = l_in.size

        self.w = self.init(
            (self.n_in, self.size),
            fan_in=self.n_in,
            name=self._name_param("w")
        )
        self.b = inits.const(
            (self.size, ),
            val=0.1,
            name=self._name_param("b")
        )
        self.params = [self.w, self.b]
Пример #3
0
    def _init_input_connections(self, n_in):
        self.w = self.init((n_in, self.size * 4),
                           fan_in=n_in,
                           name=self._name_param("W"))
        self.b = inits.const((self.size * 4, ),
                             0.1,
                             name=self._name_param("b"))

        #self.br = self.init((self.size * 4, ),
        #                   layer_width=self.size,
        #                   scale=self.init_scale,
        #                   name=self._name_param("br"))

        # Initialize forget gates to large values.
        b = self.b.get_value()
        b[:self.size] = 1.0
        #b[self.size:] = 0.0
        self.b.set_value(b)
Пример #4
0
    def _init_input_connections(self, n_in):
        self.w = self.init((n_in, self.size * 4),
                           fan_in=n_in,
                           name=self._name_param("W"))
        self.b = inits.const((self.size * 4, ),
                             0.1,
                             name=self._name_param("b"))

        #self.br = self.init((self.size * 4, ),
        #                   layer_width=self.size,
        #                   scale=self.init_scale,
        #                   name=self._name_param("br"))

        # Initialize forget gates to large values.
        b = self.b.get_value()
        b[:self.size] = 1.0
        #b[self.size:] = 0.0
        self.b.set_value(b)