loss functions

一些常见的损失函数调包就行,复杂的得自己写。损失函数中没有可训练的参数,因此通常直接使用torch.nn.functional中的函数即可。例如一些简单的损失函数:

1
2
3
4
import torch.nn as nn
cls_criterion = nn.CrossEntropyLoss()
dist_criterion = nn.MSELoss() # Use L2 loss function
hinge_criterion = nn.HingeEmbeddingLoss()

还可以参照pytorch-metric-learning这个库

CloudCompare源代码学习

目的

想使用一下CloudCompare自带的八叉树,替换掉nanoflann。nanoflann在某些特殊场景下返回的结果是有问题的,导致程序出现异常。

pcl中的体素滤波

体素滤波

  Voxel滤波作为一种很常见的滤波方法,但是其PCL内部代码却值得学习,因此今天转载一篇关于pcl中实现的体素滤波的方法。
基本上参考博客:https://blog.csdn.net/u013630299/article/details/105661194

OSG中的坐标系

OSG中的坐标系和OpenGL中的坐标系

OSG中采用四元数表示旋转:osg::Quat(angle to rotate, rotate around axis);

///***
///Q quaternion * P quaternion means that first conduct a rotation P,Second conduct a rotation Q, means a fusion about two rotations with a multiplication operation ///***

The osg coordinate definition as left-hand coordinate which is right-front-up(x-y-z) and the OpenGL coordinate definition also as left-hand coordinate which is right-up-behind(x-y-z), z axis is pointer to outside the screen The OSG default viewport is along down direction, so heading is rotate to be equal to the y positive direction, rotate axis is x axis

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×