Browse Source

linting

main
Michael Pilosov, PhD 9 months ago
parent
commit
0dc1927d2e
  1. 12
      check.py
  2. 4
      newsearch.py

12
check.py

@ -1,6 +1,6 @@
# import matplotlib.patches as patches # import matplotlib.patches as patches
from typing import Union
from pathlib import Path from pathlib import Path
from typing import Union
import matplotlib.patches as patches import matplotlib.patches as patches
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
@ -46,8 +46,10 @@ def create_circle(
ckpt: Union[str, ColorTransformerModel], fname: str, skip: bool = True, **kwargs ckpt: Union[str, ColorTransformerModel], fname: str, skip: bool = True, **kwargs
): ):
if isinstance(ckpt, str): if isinstance(ckpt, str):
import yaml
M = ColorTransformerModel.load_from_checkpoint(ckpt, map_location=lambda storage, loc: storage) M = ColorTransformerModel.load_from_checkpoint(
ckpt, map_location=lambda storage, loc: storage
)
else: else:
M = ckpt M = ckpt
@ -152,7 +154,9 @@ if __name__ == "__main__":
if len(ckpt) > 0: if len(ckpt) > 0:
ckpt = ckpt[-1] ckpt = ckpt[-1]
print(f"Generating image for checkpoint: {ckpt}") print(f"Generating image for checkpoint: {ckpt}")
create_circle(ckpt, fname=name, dpi=args.dpi, figsize=[args.figsize] * 2, roll=False) create_circle(
ckpt, fname=name, dpi=args.dpi, figsize=[args.figsize] * 2, roll=False
)
else: else:
print(f"No checkpoint found for version {v}") print(f"No checkpoint found for version {v}")
# make_image(ckpt, fname=name + "b", color=False, dpi=args.dpi,) # make_image(ckpt, fname=name + "b", color=False, dpi=args.dpi,)

4
newsearch.py

@ -27,7 +27,7 @@ learning_rate_values = [1e-3]
# learning_rate_values = [5e-4] # learning_rate_values = [5e-4]
# alpha_values = [0, .25, 0.5, 0.75, 1] # alpha = 0 is unsupervised. alpha = 1 is supervised. # alpha_values = [0, .25, 0.5, 0.75, 1] # alpha = 0 is unsupervised. alpha = 1 is supervised.
alpha_values = [0] alpha_values = [0.1]
# widths = [2**k for k in range(4, 13)] # widths = [2**k for k in range(4, 13)]
# depths = [1, 2, 4, 8, 16] # depths = [1, 2, 4, 8, 16]
widths, depths = [512], [4] widths, depths = [512], [4]
@ -80,7 +80,7 @@ python newmain.py fit \
--model.depth {d} \ --model.depth {d} \
--model.bias true \ --model.bias true \
--model.loop true \ --model.loop true \
--model.transform tanh \ --model.transform relu \
--trainer.min_epochs 10 \ --trainer.min_epochs 10 \
--trainer.max_epochs {me} \ --trainer.max_epochs {me} \
--trainer.log_every_n_steps 3 \ --trainer.log_every_n_steps 3 \

Loading…
Cancel
Save