Beispiel #1
0
 def initialize_param(self):
     self.param = tfg.Variable(tff.get_truncated_normal(shape=self.shape,
                                                        mean=self.mean,
                                                        sd=self.sd,
                                                        low=self.low,
                                                        upp=self.upp),
                               name=self.name)
Beispiel #2
0
 def initialize_param(self):
     sd = math.sqrt(1.0 / self.shape[0])
     self.param = tfg.Variable(tff.get_truncated_normal(shape=self.shape,
                                                        mean=self.mean,
                                                        sd=sd,
                                                        low=-sd,
                                                        upp=sd), name=self.name)
Beispiel #3
0
 def initialize_param(self):
     sd = math.sqrt(2.0 / (self.shape[1] * self.shape[2] * self.shape[3]))
     self.param = tfg.Variable(tff.get_truncated_normal(shape=self.shape,
                                                        mean=0.0,
                                                        sd=sd,
                                                        low=-sd,
                                                        upp=sd),
                               name=self.name)
Beispiel #4
0
 def initialize_param(self):
     if len(self.shape) == 2:
         sd = math.sqrt(2.0 / (self.shape[0] + self.shape[1]))
     else:
         sd = math.sqrt(2.0 / self.shape[0])
     self.param = tfg.Variable(tff.get_truncated_normal(shape=self.shape,
                                                        mean=self.mean,
                                                        sd=sd,
                                                        low=-sd,
                                                        upp=sd), name=self.name)