amirhfarzaneh / lsoftmax-pytorch Goto Github PK
View Code? Open in Web Editor NEWThe Pytorch Implementation of L-Softmax
The Pytorch Implementation of L-Softmax
hi, very thanks for your contributions.
when i read calculate_cos_m_theta function in LSoftmaxLinear implementions,
i notice that torch.cos(2*torch.acos(cos_theta)) can simply compute cos_m_theta , why not use it ?
maybe i have some misunderstands
Can lsoftmax be transformed into ONNX?
Hi,
I am unable to understand why target would become None in line 55 of lsoftmax.py.
When I run your model, there will be this error, is there any solution? Thank you very much!
one of the variables needed for gradient computation has been modified by an inplace operation: [torch.cuda.FloatTensor [256, 10]], which is output 0 of MmBackward, is at version 1; expected version 0 instead. Hint: enable anomaly detection to find the operation that failed to compute its gradient, with torch.autograd.set_detect_anomaly(True).
Hi, @amirhfarzaneh !
In __init__
, you forgot to call method reset_parameters
, because of this weight of the linear layer -- it's just zeros and the loss goes to nan
I tried to train with cifar10 and set margin to 2, but got nan.
learning rate is set to 0.1.
Any idea?
thanks for your work,but maybe there is some problems in models.py.
In paper,conv_2 is 3 conv2d
while in your implementation there are 4 conv2d
self.conv_2 = nn.Sequential( nn.Conv2d(64, 64, 3, padding=1), nn.PReLU(), nn.BatchNorm2d(64), nn.Conv2d(64, 64, 3, padding=1), nn.PReLU(), nn.BatchNorm2d(64), nn.Conv2d(64, 64, 3, padding=1), nn.PReLU(), nn.BatchNorm2d(64), nn.Conv2d(64, 64, 3, padding=1), nn.PReLU(), nn.BatchNorm2d(64), nn.MaxPool2d(2, 2) )
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.