‘Time.timeScale‘ is a property in Unity that affects the scale at which time passes in the game. This property can be used to create effects such as slow […]
Fixed update with Physics.Simulate in Unity
When we set ‘Physics.simulationMode’ to ‘Script’, we can manually control the fixed update using ‘Physics.Simulate’. Here, we observe the differences when ‘Physics.simulationMode’ is placed at the top or […]
OpenMP and MPI
OpenMP(Open Multi-Processing) is an application programming interface (library) that supports multi-platform shared-memory parallel programming in C, C++ and Fortran on all architectures, including Unix and Windows platform. It […]
mean rewrad in SubprocVecEnv
In Stable Baseline3, when using environments like ‘SubprocVecEnv’ for parallel environment management, the mean reward isn’t displayed by default during the training phase. This is because ‘SubprocVecEnv’ runs […]
GBDT核心源码解析
【文章发布的比较早,新版sklearn已经使用Rust重写了,只能用来凑热闹了】 sklearn中对GBDT的实现是完全遵从论文 Greedy Function Approximation的,我们一起来看一下是怎么实现的。GBDT源码最核心的部分应该是对Loss Function的处理,因为除去Loss部分的代码其他的都是非常直觉且标准的程序逻辑,反正我们就从sklearn对loss的实现开始看吧~~ Loss Function 的实现 以二分类任务为例,loss采用Binomial Deviance,看这个loss很陌生,其实跟我们熟悉的negative log-likelihood / cross entropy 是一回事,因为是二分类问题嘛,模型最终输出其实就是$P(y=1|x)$,即样本$x$是正例的概率,我们把这个概率标记成$p(x)$,那么Binomial Deviance等于 $$\ell(y, F(x)) = -\left [ y\log(p(x)) + (1 – y)\log(1-p(x)) \right […]
XGBoost自定义目标函数
xgboost内置了足够丰富的目标函数(objective function),正常来说是能够应付日常需求的,如果~万一~你有特殊需求,它也可以自定义目标函数,或者叫损失函数(loss function),这里介绍下怎么自定义目标函数。
Python多进程间共享对象
Python通过multiprocessing.Manager实现多进程间的对象共享。通过继承managers.BaseManager还可以自定义共享对象。