Giter VIP home page Giter VIP logo

softmax_variants's People

Contributors

yirongmao avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

softmax_variants's Issues

In class LGMLoss(nn.Module), which is the implementation of the original paper the covariance was considered as identity matrix instead of a diagonal matrix

In the following two lines from class LGMLoss(nn.Module),
log_covs = torch.unsqueeze(self.log_covs, dim=0)
covs = torch.exp(log_covs) # 1cd

the covariance matrix is considered as an identity matrix even though this is the implementation of the original paper whereas in the class LGMLoss_v0(nn.Module), (mentioned as 'LGMLoss whose covariance is fixed as Identity matrix' in the comments) no covariance matrix was considered.

Why is LGMLoss `margin_logits` is equivalent eq.17

train_mnist_LGM_u.py中用 margin_logits过了一个 nn.CrossEntropyLoss

我根据您的代码推了一下公示,想确认一下是不是 margin_logits 过一层 LogSoftmax之后才等于原论文中的 eq.17 ?
OqBkgH.png

loss.data[0] gives an error instead use loss.item()

print('Epoch [%d], Iter [%d/%d] Loss: %.4f Acc %.4f'
% (epoch, i + 1, len(train_loader) // batch_size, loss.data[0], accuracy))

gave an error,
*** IndexError: invalid index of a 0-dim tensor. Use tensor.item() to convert a 0-dim tensor to a Python number
Replacing loss.data[0] to loss.item() has solved the issue.

How to understand the centers shown in the LMCL_loss?

You have done a great work.

But I have a question about the LMCL_loss. How to understand the centers as show bellow:

image

I think thay are stand for the parameters of the last fully connected layer. But I wonder how to upodate them. In your code, I think they are fixed values, are they?

Looking forward to your reply.

Margin in LMCL loss might have some problems.

Hi,
According to LMCL paper, the margin was only computed between feature x and its own class weight W.
Hence I think label should be passed into your implementation and LMCL_loss should be modified.

LGM loss训练时出现loss为负值

LGM loss训练时大概20epoch 以后loss为负值,一直持续到结束,但是测试时效果还不错,请问loss的负值如何解决呢,期待您的回复!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.