Shiroi-max
commited on
Commit
•
8abb79b
1
Parent(s):
f607ebc
Reset
Browse files
logs/train_example/events.out.tfevents.1717881552.federatedlearning.3513992.0
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:25fdd45d3190a053834cb6569184eea0d2dc2bfce873bf6e3d0ff6cd3652bafa
|
3 |
-
size 118824
|
|
|
|
|
|
|
|
pipeline.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
from typing import List, Optional, Tuple, Union
|
2 |
-
from diffusers import DiffusionPipeline, ImagePipelineOutput
|
|
|
3 |
|
4 |
import torch
|
5 |
|
@@ -22,26 +23,21 @@ class DDPMConditionalPipeline(DiffusionPipeline):
|
|
22 |
return_dict: bool = True,
|
23 |
) -> Union[ImagePipelineOutput, Tuple]:
|
24 |
# Sample gaussian noise to begin loop
|
25 |
-
if isinstance(self.unet.
|
26 |
image_shape = (
|
27 |
batch_size,
|
28 |
-
self.unet.
|
29 |
-
self.unet.
|
30 |
-
self.unet.
|
31 |
)
|
32 |
else:
|
33 |
image_shape = (
|
34 |
batch_size,
|
35 |
-
self.unet.
|
36 |
-
*self.unet.
|
37 |
)
|
38 |
|
39 |
-
|
40 |
-
# randn does not work reproducibly on mps
|
41 |
-
image = randn_tensor(image_shape, generator=generator)
|
42 |
-
image = image.to(self.device)
|
43 |
-
else:
|
44 |
-
image = randn_tensor(image_shape, generator=generator, device=self.device)
|
45 |
|
46 |
# set step values
|
47 |
self.scheduler.set_timesteps(num_inference_steps)
|
|
|
1 |
from typing import List, Optional, Tuple, Union
|
2 |
+
from diffusers import DiffusionPipeline, ImagePipelineOutput
|
3 |
+
from diffusers.utils.torch_utils import randn_tensor
|
4 |
|
5 |
import torch
|
6 |
|
|
|
23 |
return_dict: bool = True,
|
24 |
) -> Union[ImagePipelineOutput, Tuple]:
|
25 |
# Sample gaussian noise to begin loop
|
26 |
+
if isinstance(self.unet.model.sample_size, int):
|
27 |
image_shape = (
|
28 |
batch_size,
|
29 |
+
self.unet.model.in_channels,
|
30 |
+
self.unet.model.sample_size,
|
31 |
+
self.unet.model.sample_size,
|
32 |
)
|
33 |
else:
|
34 |
image_shape = (
|
35 |
batch_size,
|
36 |
+
self.unet.model.in_channels,
|
37 |
+
*self.unet.model.sample_size,
|
38 |
)
|
39 |
|
40 |
+
image = randn_tensor(image_shape, generator=generator)
|
|
|
|
|
|
|
|
|
|
|
41 |
|
42 |
# set step values
|
43 |
self.scheduler.set_timesteps(num_inference_steps)
|
scheduler/scheduler_config.json
DELETED
@@ -1,19 +0,0 @@
|
|
1 |
-
{
|
2 |
-
"_class_name": "DDPMScheduler",
|
3 |
-
"_diffusers_version": "0.28.0",
|
4 |
-
"beta_end": 0.02,
|
5 |
-
"beta_schedule": "linear",
|
6 |
-
"beta_start": 0.0001,
|
7 |
-
"clip_sample": true,
|
8 |
-
"clip_sample_range": 1.0,
|
9 |
-
"dynamic_thresholding_ratio": 0.995,
|
10 |
-
"num_train_timesteps": 1000,
|
11 |
-
"prediction_type": "epsilon",
|
12 |
-
"rescale_betas_zero_snr": false,
|
13 |
-
"sample_max_value": 1.0,
|
14 |
-
"steps_offset": 0,
|
15 |
-
"thresholding": false,
|
16 |
-
"timestep_spacing": "leading",
|
17 |
-
"trained_betas": null,
|
18 |
-
"variance_type": "fixed_small"
|
19 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
unet/config.json
DELETED
@@ -1,45 +0,0 @@
|
|
1 |
-
{
|
2 |
-
"_class_name": "UNet2DModel",
|
3 |
-
"_diffusers_version": "0.27.2",
|
4 |
-
"act_fn": "silu",
|
5 |
-
"add_attention": true,
|
6 |
-
"attention_head_dim": 8,
|
7 |
-
"attn_norm_num_groups": null,
|
8 |
-
"block_out_channels": [
|
9 |
-
128,
|
10 |
-
128,
|
11 |
-
256,
|
12 |
-
512
|
13 |
-
],
|
14 |
-
"center_input_sample": false,
|
15 |
-
"class_embed_type": null,
|
16 |
-
"down_block_types": [
|
17 |
-
"DownBlock2D",
|
18 |
-
"DownBlock2D",
|
19 |
-
"AttnDownBlock2D",
|
20 |
-
"DownBlock2D"
|
21 |
-
],
|
22 |
-
"downsample_padding": 1,
|
23 |
-
"downsample_type": "conv",
|
24 |
-
"dropout": 0.0,
|
25 |
-
"flip_sin_to_cos": true,
|
26 |
-
"freq_shift": 0,
|
27 |
-
"in_channels": 1,
|
28 |
-
"layers_per_block": 2,
|
29 |
-
"mid_block_scale_factor": 1,
|
30 |
-
"norm_eps": 1e-05,
|
31 |
-
"norm_num_groups": 32,
|
32 |
-
"num_class_embeds": 10,
|
33 |
-
"num_train_timesteps": null,
|
34 |
-
"out_channels": 1,
|
35 |
-
"resnet_time_scale_shift": "default",
|
36 |
-
"sample_size": 32,
|
37 |
-
"time_embedding_type": "positional",
|
38 |
-
"up_block_types": [
|
39 |
-
"UpBlock2D",
|
40 |
-
"AttnUpBlock2D",
|
41 |
-
"UpBlock2D",
|
42 |
-
"UpBlock2D"
|
43 |
-
],
|
44 |
-
"upsample_type": "conv"
|
45 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
unet/diffusion_pytorch_model.safetensors
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:4d19e953d793b3cbc0f5e932f83561fb3a7b147c69c5cd473733ecdd19942ecc
|
3 |
-
size 246153668
|
|
|
|
|
|
|
|