skip over irrelevant nodes
This commit is contained in:
parent
dcbaef3032
commit
65ba80bb96
1 changed files with 10 additions and 10 deletions
20
onn_core.py
20
onn_core.py
|
@ -589,11 +589,11 @@ class Layer:
|
||||||
assert self.parents, self
|
assert self.parents, self
|
||||||
edges = []
|
edges = []
|
||||||
for parent in self.parents:
|
for parent in self.parents:
|
||||||
# TODO: skip over irrelevant nodes (if any)
|
if parent in values:
|
||||||
X = values[parent]
|
X = values[parent]
|
||||||
if not self.unsafe:
|
if not self.unsafe:
|
||||||
self.validate_input(X)
|
self.validate_input(X)
|
||||||
edges.append(X)
|
edges.append(X)
|
||||||
Y = self._propagate(edges, deterministic)
|
Y = self._propagate(edges, deterministic)
|
||||||
if not self.unsafe:
|
if not self.unsafe:
|
||||||
self.validate_output(Y)
|
self.validate_output(Y)
|
||||||
|
@ -604,11 +604,11 @@ class Layer:
|
||||||
assert self.children, self
|
assert self.children, self
|
||||||
edges = []
|
edges = []
|
||||||
for child in self.children:
|
for child in self.children:
|
||||||
# TODO: skip over irrelevant nodes (if any)
|
if child in values:
|
||||||
dY = values[child]
|
dY = values[child]
|
||||||
if not self.unsafe:
|
if not self.unsafe:
|
||||||
self.validate_output(dY)
|
self.validate_output(dY)
|
||||||
edges.append(dY)
|
edges.append(dY)
|
||||||
dX = self._backpropagate(edges)
|
dX = self._backpropagate(edges)
|
||||||
if not self.unsafe:
|
if not self.unsafe:
|
||||||
self.validate_input(dX)
|
self.validate_input(dX)
|
||||||
|
|
Loading…
Reference in a new issue