Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Questions about the distilled images? #4

Open
fofilix opened this issue Jul 3, 2024 · 1 comment
Open

Questions about the distilled images? #4

fofilix opened this issue Jul 3, 2024 · 1 comment

Comments

@fofilix
Copy link

fofilix commented Jul 3, 2024

Thank U for opening source code. But I still got a few questions as follows.

  1. When I checked the the saved distilled images, I found that you make it into the vis.pdf, a CSS sprite, encompassed a lot of small distilled images. The number of these small distilled images exceeded the default IPC setting (CIFAR10_IPC10_freenet_patch4_dec96d1b3h(), i.e., IPC is10), Why?
  2. I'm using SPEED in my own dataset. If I want to save the distilled image into folders, not *.pdf format, I think I should change the code in

    SPEED/distill.py

    Lines 222 to 231 in 64c0fc4

    image_syn_vis = copy.deepcopy(images_syn_eval.detach().cpu())
    for clip_val in [2.5]:
    std = torch.std(image_syn_vis)
    mean = torch.mean(image_syn_vis)
    upsampled = torch.clip(image_syn_vis, min=mean - clip_val * std, max=mean + clip_val * std)
    if args.dataset != "ImageNet":
    upsampled = torch.repeat_interleave(upsampled, repeats=4, dim=2)
    upsampled = torch.repeat_interleave(upsampled, repeats=4, dim=3)
    upsampled_ = upsampled.detach()
    save_image(upsampled_, save_name, nrow=10, padding=1, normalize=True, scale_each=True)
    . But I'm still confused about how to change the code cuz I'm new to Dataset Distilled field. Can U show me how to accomplish the operation?
@CAOANJIA
Copy link
Collaborator

CAOANJIA commented Jul 5, 2024

  1. Since SPEED is a synthetic data parameterization framework, more synthetic images can be produced under the same storage budget (i.e. more than 10 synthetic images per class under IPC 10).

  2. By default, we save SAET, SCM, and FReeNet, which conforms to Eq. (7). You can use the three to synthesize images, please refer to the synthesis process in 'distill.py' or 'eval.py', and the forward function of FReeNet in 'networks.py'. If you want to save the synthetic images directly, you can use 'torch.save()' to save the synthesized images (e.g. the 'pth' format). This should be easy to implement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants