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

Question regarding the prior, v2c, and hidden variables #41

Open
song-wensong opened this issue Feb 5, 2024 · 7 comments
Open

Question regarding the prior, v2c, and hidden variables #41

song-wensong opened this issue Feb 5, 2024 · 7 comments

Comments

@song-wensong
Copy link

song-wensong commented Feb 5, 2024

I have a question regarding the prior, v2c, and hidden variables in the context of a certain functionality.

Questions about prior and v2c:

If prior=True and v2c=False, does this configuration essentially prioritize reconstruction, resulting in the best possible reconstruction outcomes?

Conversely, if prior=False and v2c=True, does this configuration resemble a retrieval task, aiming for optimal retrieval performance?

In the case of prior=True and v2c=True, does this setting strike a balance between reconstruction and retrieval results?

Questions about hidden variable:

What is the effect of setting hidden to True or False when aiming for optimal reconstruction quality?

If the objective is to achieve the best possible reconstruction outcomes, would configuring the parameters as follows be advisable: prior=True, v2c=False, and hidden=True?

Thank you for your assistance and clarification!

@PaulScotti
Copy link
Collaborator

There is no priority variable, I assume you are referring to "prior"

prior=True means diffusion prior is being trained, False means it is not
v2c=True means retrieval submodule is being trained, False means it is not
hidden=True means mapping to last hidden layer of CLIP, False means mapping to final layer of CLIP

@song-wensong
Copy link
Author

There is no priority variable, I assume you are referring to "prior"

prior=True means diffusion prior is being trained, False means it is not v2c=True means retrieval submodule is being trained, False means it is not hidden=True means mapping to last hidden layer of CLIP, False means mapping to final layer of CLIP

Apologies for the confusion; indeed, I meant "prior"

I noticed in Table 4 of the paper that the reconstruction performance of Backbone + Prior surpasses that of MindEye (0.33 BiMixCo)*. If my goal is to achieve the optimal reconstruction effect, should I configure the parameters as follows: prior=True, v2c=False, and hidden=True?

@PaulScotti
Copy link
Collaborator

should be true true true

@song-wensong
Copy link
Author

should be true true true

Thank you for your assistance!
When v2c = True, the loss function becomes a combination of loss_nce and (prior_mult * loss_prior) instead of just loss_prior. Despite this change, why does enabling v2c=True lead to an improvement in the reconstruction results?

@PaulScotti
Copy link
Collaborator

We talk about this in detail in the paper

@song-wensong
Copy link
Author

We talk about this in detail in the paper

Thank you, I will take a closer look at the paper.

@song-wensong
Copy link
Author

song-wensong commented Feb 23, 2024

@PaulScotti Hello
I have solved the following problem. Thank you!


I want to use text and fMRI for contrastive learning. But the text embedding dimension is 77*768, so I changed out_dim = 257 * clip_size to out_dim = 77 * clip_size, but diffusion prior cannot be used. Then I set prior to False in Train_MindEye.py.
Then I wanted to use Reconstructions.py to reconstruct the image, but I found that in utils.reconstruction, the code still used diffusion_prior.
How should I modify it? If I directly set diffusion_priors to None, I cannot get brain_clip_embeddings. Can I make brain_clip_embeddings0, proj_embeddings = diffusion_prior.voxel2clip(voxel.to(device).float()) and
brain_clip_embeddings0 = brain_clip_embeddings0.view(len(voxel),-1,768) if isinstance(clip_extractor,Clipper) else brain_clip_embeddings0.view(len(voxel),-1,1024)
run alone and set diffusion_priors to None and continue running the code below?

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