Beispiel #1
0
    def unpack(self, X):
        ans = FNN(self.sizes, self.hid_nonlins, self.out_nonlin, 
                  init = False)
        ans.size = self.size
        from opt.utils.extra import unpack
        mats = unpack(self.W + self.b, X)

        ans.W = mats[:len(self.sizes) - 1]
        ans.b = mats[len(self.sizes) - 1:]

        return ans
Beispiel #2
0
    def unpack(self, X):
        ans = RNN(self.v, self.h, self.o,
                  self.hid_nonlin, self.out_nonlin,
                  self.struct_damp_nonlin)

        (ans.h_init,
         ans.W_hh,
         ans.W_vh,
         ans.W_ho) = unpack([self.h_init,
                               self.W_hh,
                               self.W_vh,
                               self.W_ho],
                              X)
        return ans
Beispiel #3
0
    def unpack(self, X):
        ans = MRNN(self.v, self.h, self.f, self.o,
                   self.hid_nonlin, self.out_nonlin)

        (ans.h_init,
         ans.W_hf,
         ans.W_fh,
         #ans.W_hh,
         ans.f_bias,
         ans.W_vh,
         ans.W_vf,
         ans.W_ho) = unpack([self.h_init,
                             self.W_hf,
                             self.W_fh,
                             #self.W_hh,
                             self.f_bias,
                             self.W_vh,
                             self.W_vf,
                             self.W_ho],
                            X)
        return ans