Comments (1)
您可以参考STEP的loss。
总的来说,目前自定义loss函数的参数输入需要满足下述限制:
def customized_loss(prediction, real_value, other_param_1, other_param_2, ..., null_val=np.nan):
# main loss
pass
其中,prediction, real_value, other_param_1, other_param_2, ...,这些参数是和runner的forward函数的返回值相匹配的。换句话说,runner的返回值会自动作为参数注入到loss中。同理您可以参考STEP的runner。
最后一个参数,null_val是用来识别数据集中需要被忽略的异常点,默认一般为np.nan。您可以通过CFG.NULL_VAL在配置文件中进行设定。例如,对于交通数据集来说,0值一般是异常值(传感器宕机)。我们不希望模型强制拟合这些异常值,此时的NULL_VAL就会被设定为0.0,再进一步采用masked_mae等指标。
from basicts.
Related Issues (20)
- 请问如何使用inference程序,需要改哪些部分 HOT 15
- Add contributors. HOT 16
- 请问如何修改学习率衰减器 HOT 1
- 修改数据归一化方式。 HOT 1
- MS (multivariate -> univariate)? HOT 2
- 关于数据输入和输出特征个数的问题? HOT 2
- dataloader的droplast问题 HOT 2
- STGCN 模型不能跑第二次 HOT 1
- implementation of spatial indistinguishability HOT 1
- 能否支持early stop? HOT 1
- 您好,请教一下模型训练好后如何获取预测值与真实值的数据 HOT 5
- 怎么快速的修改输入输出长度,完成不同实验? HOT 1
- 关于训练速度 HOT 3
- 如何多卡训练 HOT 2
- 关于给模型增加额外输入的问题 HOT 1
- 关于TrainingMAE与ValidationMAE的大小 HOT 5
- 预测结果可视化时,results为空
- 关于预测结果可视化的问题 HOT 8
- 如何调参
- masked_wape在处理缺失值为nan时的问题 HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from basicts.