-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
Description
I am currently reading the code and noticed we could improve the code to be more concise.
My proposal is to go from :
def forward(self, x):
x = x.repeat(1, self._options["num_cnns"], 1)
if self._options["num_fc"] <= 2:
outs = self.linears(x)
else:
outs = self.linears(x)
for i in range(len(self.linears_bg)):
outs = self.linears_bg[i](outs)
outs = self.last_linear(outs)
out = self.final(outs)to :
def forward(self, x):
x = x.repeat(1, self._options["num_cnns"], 1)
outs = self.linears(x)
if self._options["num_fc"] > 2:
for layer in self.linears_bg:
outs = layer(outs)
outs = self.last_linear(outs)
return self.final(outs)Testing
Currently, I just made sure the train can still proceed, since the update affects the networks only.
Well let me know if pull requests are welcome...
Metadata
Metadata
Assignees
Labels
No labels