def __init__(self, frame): self.frame = frame self.model = nets.NetEditor.newNet(100, 10, Neurons.Sigmoid(), nets.Net.leastSquaredDerivative, (Neurons.Sigmoid(), 55)) self.buttons = list() self.font = pygame.font.SysFont("arial", 14)
def __init__(self, n, weight_lenght, type): neurons = [] for i in range(n): weight = [] bias = random.uniform(-2, 2) for w in range(weight_lenght): weight.append(random.uniform(-2, 2)) if type == "sigmoid": neuron = Neurons.Sigmoid(weight, bias) else: neuron = Neurons.Perceptron(weight, bias) neurons.append(neuron) self.neurons = neurons self.next_layer = None self.previous_layer = None
def onClick(self): layer = nets.Layer(Neurons.Sigmoid(), 3, nets.Layer.HIDDEN) nets.NetEditor.spliceIn(layer, self.upLayer, self.downLayer)