Continuous-time Gaussian diffusion https://arxiv.org/pdf/2107.00630.pdf
| 61 | |
| 62 | |
| 63 | class ContinuousTimeGaussianDiffusion(base.GaussianDiffusion): |
| 64 | """ |
| 65 | Continuous-time Gaussian diffusion |
| 66 | https://arxiv.org/pdf/2107.00630.pdf |
| 67 | """ |
| 68 | |
| 69 | def __init__( |
| 70 | self, |
| 71 | denoiser: nn.Module, |
| 72 | criterion: Literal["l2", "l1", "huber"] | nn.Module = "l2", |
| 73 | objective: Literal["eps", "v", "x0"] = "eps", |
| 74 | prediction: Literal["eps", "v", "x0"] = "eps", |
| 75 | beta_schedule: Literal[ |
| 76 | "linear", "cosine", "cosine_shifted", "cosine_interpolated" |
| 77 | ] = "cosine", |
| 78 | min_snr_loss_weight: bool = True, |
| 79 | min_snr_gamma: float = 5.0, |
| 80 | sampling_resolution: tuple[int, int] | None = None, |
| 81 | clip_sample: bool = True, |
| 82 | clip_sample_range: float = 1, |
| 83 | image_d: float = None, |
| 84 | noise_d_low: float = None, |
| 85 | noise_d_high: float = None, |
| 86 | num_training_steps: int = 1000, |
| 87 | classifier_free_scale: float = 7.5, |
| 88 | sampling: str= "ddpm", |
| 89 | use_seg: bool = False, |
| 90 | use_guidence_net: bool = False, |
| 91 | guidence_step_interval: int = -1, |
| 92 | guidence_weights: tuple = None, |
| 93 | use_control_net = False, |
| 94 | upsampling = False, |
| 95 | up_rate=2, |
| 96 | base_up_rate=0.25, |
| 97 | downsampling =False, |
| 98 | down_rate=0.5, |
| 99 | base_down_rate=1.0, |
| 100 | interpolate_rate=0.5, |
| 101 | inference=False |
| 102 | ): |
| 103 | super().__init__( |
| 104 | denoiser=denoiser, |
| 105 | sampling=sampling, |
| 106 | criterion=criterion, |
| 107 | num_training_steps=num_training_steps, |
| 108 | objective=objective, |
| 109 | prediction=prediction, |
| 110 | beta_schedule=beta_schedule, |
| 111 | min_snr_loss_weight=min_snr_loss_weight, |
| 112 | min_snr_gamma=min_snr_gamma, |
| 113 | sampling_resolution=sampling_resolution, |
| 114 | clip_sample=clip_sample, |
| 115 | clip_sample_range=clip_sample_range, |
| 116 | classifier_free_scale=classifier_free_scale, |
| 117 | use_seg=use_seg, |
| 118 | use_guidence_net=use_guidence_net, |
| 119 | guidence_step_interval=guidence_step_interval, |
| 120 | guidence_weights=guidence_weights, |
no outgoing calls
no test coverage detected