torchsort:在PyTorch中进行快速,可区分的排序和排名

时间:2021-03-25 14:29:34
【文件属性】:
文件名称:torchsort:在PyTorch中进行快速,可区分的排序和排名
文件大小:129KB
文件格式:ZIP
更新时间:2021-03-25 14:29:34
pytorch sort ranking cuda-kernel Cuda 火炬排序 在PyTorch中进行快速,可区分的排序和排名。 纯PyTorch实现(Blondel等人)。 大部分代码是从的原始Numpy实现复制而来的,等渗回归求解器被重写为PyTorch C ++和CUDA扩展。 安装 pip install torchsort 要构建CUDA扩展,您将需要安装CUDA工具链。 如果要在没有CUDA运行时的环境中构建(例如docker),则需要在安装之前导出环境变量TORCH_CUDA_ARCH_LIST="Pascal;Volta;Turing" 。 用法 torchsort公开了两个函数: soft_rank和soft_sort ,每个函数都有参数regularization ( "l2"或"kl" )和regularization_strength (标量值)。 每个人都将对二维张量的最后一个维度进行排序/排序,其准确性取决于正则化强度:
【文件预览】:
torchsort-main
----extra()
--------benchmark_cuda.png(53KB)
--------benchmark.py(4KB)
--------benchmark.png(63KB)
----push_pypi.sh(71B)
----.github()
--------workflows()
----tests()
--------test_ops.py(2KB)
----LICENSE(11KB)
----requirements.txt(13B)
----setup.py(2KB)
----.gitignore(2KB)
----README.md(4KB)
----torchsort()
--------__init__.py(47B)
--------isotonic_cpu.cpp(12KB)
--------isotonic_cuda.cu(14KB)
--------ops.py(5KB)

网友评论