Skip to content

Instantly share code, notes, and snippets.

@wfnian
wfnian / focal_loss.py
Created November 7, 2021 03:13
focal_loss.py
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
# 支持多分类和二分类
class FocalLoss(nn.Module):
"""
This is a implementation of Focal Loss with smooth label cross entropy supported which is proposed in
@y0ngb1n
y0ngb1n / docker-registry-mirrors.md
Last active October 18, 2025 12:13
国内的 Docker Hub 镜像加速器,由国内教育机构与各大云服务商提供的镜像加速服务 | Dockerized 实践 https://github.com/y0ngb1n/dockerized
@jingmian
jingmian / ShadowSocks.sh
Last active January 9, 2023 05:27
Ubuntu下安装ShadowSocks客户端
sudo apt-get update
sudo apt-get install python-pip
sudo apt-get install python-setuptools m2crypto
pip install shadowsocks
如果是ubuntu16.04 直接 (16.04 里可以直接用apt 而不用 apt-get 这是一项改进)
sudo apt install shadowsocks
nohup sslocal -c /opt/trainee/shadowsocks.json &