if k in self.inputs and v in layer.outputs:
self.inputs[k].set_previous(layer.outputs[v])
else:
raise Exception("Invalid connection map.")
def get_input(self, train=False):
if len(self.inputs) == len(self.outputs) == 1:
return self.inputs[self.input_order[0]].get_input(train)
After Change
Note: `Graph` can only be used as a layer
(connect, input, get_input, get_output)
when it has exactly one input and one output.
"""
def __init__(self):
self.namespace = set() // strings
self.nodes = OrderedDict() // layer-like