in jcm/models/layers.py [0:0]
def __call__(self, xs, y):
rcu_block = functools.partial(
CondRCUBlock,
n_blocks=2,
n_stages=2,
act=self.act,
normalizer=self.normalizer,
)
rcu_block_output = functools.partial(
CondRCUBlock,
features=self.features,
n_blocks=3 if self.end else 1,
n_stages=2,
act=self.act,
normalizer=self.normalizer,
)
hs = []
for i in range(len(xs)):
h = rcu_block(features=xs[i].shape[-1])(xs[i], y)
hs.append(h)
if not self.start:
msf = functools.partial(
CondMSFBlock,
features=self.features,
interpolation=self.interpolation,
normalizer=self.normalizer,
)
h = msf(shape=self.output_shape)(hs, y)
else:
h = hs[0]
crp = functools.partial(
CondCRPBlock,
features=self.features,
n_stages=2,
act=self.act,
normalizer=self.normalizer,
)
h = crp()(h, y)
h = rcu_block_output()(h, y)
return h