mccreezhao / fr-loss-on-mnist Goto Github PK
View Code? Open in Web Editor NEWFace Recognition Loss on Mnist, Pytorch implementation
License: MIT License
Face Recognition Loss on Mnist, Pytorch implementation
License: MIT License
你好,为什么我运行之后没有出现可视化的结果呢?还有. pkl文件没有放到生成的对应的name文件夹之下,可以稍微完善一下
I want to know how to draw visualization picture and store it.thanks
The loss does not converge.
hi, could you share the paper about QAMFace? thank you.
def forward(self, x, label):
cosine = F.normalize(x).mm(F.normalize(self.weight, dim=0))
sine = torch.sqrt(1.0 - torch.pow(cosine, 2))
phi = cosine * self.cos_m - sine * self.sin_m # 两角和公式
# 为了保证cos(theta+m)在0-pi单调递减:
phi = torch.where((cosine - self.th) > 0, phi, cosine - self.mm)
one_hot = torch.zeros_like(cosine)
one_hot.scatter_(1, label.view(-1, 1), 1)
output = (one_hot * phi) + ((1.0 - one_hot) * cosine)
output = output * self.s
#这里这个s比较关键,如果设置的不够大会导致收敛困难,
# 比较容易出现两个类别的Feature重叠的现象,
# 这也是加性Margin相对于乘性Margin的一个比较弱势的地方,
# 对于特征向量的收缩要求足够,但是对两类特征向量之间的距离约束不够
loss = F.cross_entropy(cosine, label)
return loss, output
在这段 loss = F.cross_entropy(cosine, label)应该写成loss = F.cross_entropy(output, label), 但是如果这样写的话loss一下就成nan了, 我也在解决这个问题, 感觉就像lenet++不适合arcface一样
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.