Open nbren12 opened 3 months ago
@mnabian I could make this refactor if you like. Thoughts?
For example, this code:
# Parse deterministic sampler options
sigma_min = getattr(cfg, "sigma_min", None)
sigma_max = getattr(cfg, "sigma_max", None)
rho = getattr(cfg, "rho", 7)
solver = getattr(cfg, "solver", "heun")
discretization = getattr(cfg, "discretization", "edm")
schedule = getattr(cfg, "schedule", "linear")
scaling = getattr(cfg, "scaling", None)
S_churn = getattr(cfg, "S_churn", 0)
S_min = getattr(cfg, "S_min", 0)
S_max = getattr(cfg, "S_max", float("inf"))
S_noise = getattr(cfg, "S_noise", 1)
would change to
@dataclass
class SamplerConfig:
sigma_min: Optional[float] = None
sigma_max: Optional[float] = None
rho: int = 7
solver: str = "heun"
discretization: str = "edm"
schedule: str = "linear"
scaling: Optional[float] = None
S_churn: int = 0
S_min: int = 0
S_max: float = float("inf")
S_noise: int = 1
Yes I think this will clean up the configs. Please go ahead and let me know if I can help.
@nbren12 is this still WIP? :) I'd volunteer take it off your plate if not.
Go for it @DavidLandup0 !
@nbren12 thanks! I'll open a PR later today or tomorrow :)
_Originally posted by @nbren12 in https://github.com/NVIDIA/modulus/pull/401#discussion_r1537923976_