def __init__(self, start_shape, stop_shape, depth=2, conv_part=Conv1dAC): _Net.__init__(self, start_shape, stop_shape, depth) self.conv_part = conv_part(start_shape=start_shape, stop_shape=stop_shape, depth=depth, bias_prob=0.3) self.lin_part = LinearAC(start_shape=None, stop_shape=(10, ), depth=depth, bias_prob=0.3) self.change_num = IntParam(name="")
def __init__( self, start_shape, stop_shape, min_features=10, max_features=128, depth=2, bias_prob=0.0, ): _Net.__init__(self, start_shape, stop_shape, depth) self.layers = [Linear(bias=False)] self.limits = (min_features, max_features) if bias_prob > 0: self.layers[0].bias.randomize(true_prob=bias_prob) self.layers[0].out_features.randomize(limits=self.limits)
def __call__(self, num_nets, startnum=1): t = self.layers[0].bias if t.is_random and t.true_prob > 0: if "Only" in self.name: self.name = self.name.replace("Only", "Bias") elif "Bias" not in self.name: self.name = self.name + "Bias" return _Net.__call__(self, num_nets, startnum)
def __call__(self, num_nets, startnum=1): self.name = "{}".format( self.__class__.__name__.replace("AC", self.ac.val.__class__.__name__)) return _Net.__call__(self, num_nets, startnum)
def __init__(self, start_shape, stop_shape, depth, convclass, bias_prob=0): _Net.__init__(self, start_shape, stop_shape, depth) self.layers = [convclass()] self.layers[0].out_channels.randomize(limits=(self.stop_shape[0], 64)) if bias_prob > 0: self.layers[0].bias.randomize(true_prob=bias_prob)
def __call__(self, num_nets, startnum=1): self.name = "Linear{}".format(self.ac.val.__class__.__name__) return _Net.__call__(self, num_nets, startnum)
def __init__(self, start_shape, stop_shape, depth=3): _Net.__init__(self, start_shape, stop_shape, depth) self.layers.append(Conv2dAC(start_shape, [10, 1, 1], depth)) self.layers.append(Conv2dThenLinear(start_shape, [10, 1, 1], depth)) self.change_num = IntParam("", default=1)