def __init__(self, x, y, w, h, text='x_0'): NodeFigure.__init__(self, x, y, w, h, 0, text) self.setForwardPrintable(True) self.setFillColor(220, 220, 220, 255) # green self.figures[0].setColor(pyHAttributeColor(170, 170, 170, 255)) self._paint()
def __init__(self, x, y, w, h, text='w_0'): NodeFigure.__init__(self, x, y, w, h, 0, text) self.setForwardPrintable(True) self.setFillColor(189, 221, 187, 255) # green self.figures[0].setColor(pyHAttributeColor(136, 159, 135, 255)) self._paint()
def __init__(self, x, y, w, h): NodeFigure.__init__(self, x, y, w, h, 1, '\mathrm{\mathsf{tanh}}')
def __init__(self, x, y, w, h): NodeFigure.__init__(self, x, y, w, h, 2, '\mathrm{\mathsf{add}}') self.set_text(self.get_operation())
def __init__(self, x, y, w, h): NodeFigure.__init__(self, x, y, w, h, 2, '\mathrm{\mathsf{max}}')
def __init__(self, x, y, w, h): NodeFigure.__init__(self, x, y, w, h) self._internal_net = {'inputs': [], 'weight': [], 'net': []} self.createInternalNet() self.assignNetPosition()
def __init__(self, x, y, w, h): NodeFigure.__init__(self, x, y, w, h, 2, 'mse')
def notifyFigureChanged(self): NodeFigure.notifyFigureChanged(self)
def invert_dot_to_calculate_partial(self): invert = NodeFigure.invert_dot_to_calculate_partial(self) invert[self.get_inputs_nodes()[1]] = True return invert
def are_all_inputs_occupied(self): inputs_occupied = NodeFigure.are_all_inputs_occupied(self) variables_assigned = all(v is not None for v in self._variables.values()) return inputs_occupied and variables_assigned
def getHandles(self): h = [] if self.node is not None: h = NodeFigure.getHandles(self) return h + self._create_variables_handles()
def __init__(self, x, y, w, h, num_inputs, op='op', fl='f'): # super NodeFigure.__init__(self, x, y, w, h, num_inputs, op, fl) self._variables = {}
def are_all_inputs_occupied(self): inputs_occupied = NodeFigure.are_all_inputs_occupied(self) variables_assigned = self.get_variable('neurons') is not None return inputs_occupied and variables_assigned
def forward(self): NodeFigure.forward(self) w = self.get_node()