Fix black

This commit is contained in:
D-X-Y 2021-04-23 02:14:49 -07:00
parent 9b895bdf2e
commit 77c250c8fc
2 changed files with 13 additions and 9 deletions

View File

@ -92,7 +92,11 @@ def main(save_dir):
model, loss_fn, train_loss = optimize_fn(train_xs, train_ys)
# model, loss_fn, train_loss = optimize_fn(xaxis_all, yaxis_all)
pred_valid_ys, valid_loss = evaluate_fn(model, valid_xs, valid_ys, loss_fn)
print("[{:03d}] T-{:03d}, train-loss={:.5f}, valid-loss={:.5f}".format(idx, timestamp, train_loss, valid_loss))
print(
"[{:03d}] T-{:03d}, train-loss={:.5f}, valid-loss={:.5f}".format(
idx, timestamp, train_loss, valid_loss
)
)
# the first plot
scatter_list = []
@ -114,7 +118,7 @@ def main(save_dir):
"color": "r",
"s": 10,
"alpha": 0.5,
"label": "MLP at now"
"label": "MLP at now",
}
)

View File

@ -49,8 +49,8 @@ class SuperModule(abc.ABC, nn.Module):
def add_module(self, name: str, module: Optional[torch.nn.Module]) -> None:
if not isinstance(module, SuperModule):
warnings.warn(
"Add {:} module, which is not SuperModule, into {:}".format(
name, self.__class__.__name__
"Add {:}:{:} module, which is not SuperModule, into {:}".format(
name, module.__class__.__name__, self.__class__.__name__
)
+ "\n"
+ "It may cause some functions invalid."