Skip to content

style feature need to add noise? #6

@bjtuln

Description

@bjtuln

When would it be better to add noise to style feature?

if style_extractor is not None:

            b, e = emb.shape
            
            y = y.reshape(b, 5, -1)
            y = torch.mean(y, dim=1)

            noise=False
            if noise==True:
                magn = torch.norm(y, dim=1, keepdim=True)
                noise = torch.randn_like(y)*0.25
                #bernoulli mask in noise
                noise = noise*torch.bernoulli(torch.ones_like(noise)*0.2)
                
                y = y + noise
                y = magn * y / torch.norm(y, dim=1, keepdim=True)
            
            y = self.style_lin(y)
            
            emb = emb + y 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions