当前位置:网站首页>The principle and implementation of loss function cross entropy
The principle and implementation of loss function cross entropy
2022-07-28 02:07:00 【Falling gold】
Cuckoo ~ No hurry, no change
What is the loss function , The function of the loss function is ?
What are the commonly used loss functions ? What is a mathematical expression ?
Realization
The principle of cross entropy
Realization
pytorch Self contained cross entropy :
class CrossEntropyLoss(_WeightedLoss):
__constants__ = ['ignore_index', 'reduction']
ignore_index: int
def __init__(self, weight: Optional[Tensor] = None, size_average=None, ignore_index: int = -100,
reduce=None, reduction: str = 'mean') -> None:
super(CrossEntropyLoss, self).__init__(weight, size_average, reduce, reduction)
self.ignore_index = ignore_index
def forward(self, input: Tensor, target: Tensor) -> Tensor:
assert self.weight is None or isinstance(self.weight, Tensor)
return F.cross_entropy(input, target, weight=self.weight,
ignore_index=self.ignore_index, reduction=self.re边栏推荐
- [interview: concurrent article 28:volatile] orderliness
- 什么是方法,什么是方法论:了解自我精进提升的底层逻辑
- Fiddler mobile packet capturing agent settings (for Huawei glory 60s)
- 如何评估研发人员效能?软件工程师报告帮你看见每个人的贡献
- sftp文件/文件夹上传服务器
- 记录一次生产死锁
- Traversal and properties of binary trees
- Zkrollup learning materials summary
- FreeRTOS kernel summary
- Dpdk plug-in of VPP
猜你喜欢

UE4 unreal ndisplay plug-in easy to use three fold screen details

Completely delete MySQL in Linux system

Vxe table/grid cell grouping and merging

ArcGIS:加载历史遥感影像

学习了循环碰到了编写计算n的阶乘的题目,由此引发了一系列问题,包括一些初学者常见的坑,以及如何简化代码

After learning the loop, I came across the problem of writing factorial of N, which caused a series of problems, including some common pitfalls for beginners, and how to simplify the code

FreeRTOS kernel summary

Fiddler mobile packet capturing agent settings (for Huawei glory 60s)

机器学习如何做到疫情可视化——疫情数据分析与预测实战

BGP federal experiment
随机推荐
数字经济才是未来经济发展的核心
They are all talking about Devops. Do you really understand it?
Completely delete MySQL in Linux system
【面试:并发篇28:volatile】有序性
软件测试面试题:为什要在一个团队中开展测试工作?
Domain Driven Design -- Terminology
云原生爱好者周刊:Prometheus 架构演进之路
测试/开发程序员的级别“陷阱“,级别不是衡量单维度的能力......
Starfish Os X MetaBell战略合作,元宇宙商业生态更进一步
Leveraging the blue ocean of household appliances consumption with "digital channels", the dealer online system enables enterprises to further their business
每条你收藏的资讯背后,都离不开TA
Digital economy is the core of future economic development
Gbase 8C transaction ID and snapshot
数据安全与隐私计算峰会-可证明安全:学习
自定义类型:结构体,枚举,联合
Thinking about some things
Huawei app UI automation test post interview real questions, real interview experience.
LeetCode高频题128. 最长连续序列,经常被互联网大厂面试考到
focal loss原理及实现
Codeforces Round #810 (Div. 2)A~C题解