东拼西凑出一个Ghost主题。主要参考了 Cho 的Bitcron自用主题样式,加入了移动端菜单、底栏以及 Ghost 的一些特色功能。前端技术栈弱鸡,只会复制粘贴加调试,小毛病是永远都不可能改完的。

Graphic design is the paradise of individuality, eccentricity, heresy, abnormality, hobbies, and humors. — George Santayana


图骗示例:

about-1-2


代码示例:

import torch
import torch.nn as nn

class DiceLoss(nn.Module):
    def __init__(self, eps=1e-5):
        super().__init__()
        self.eps = eps

    def forward(self, prediction, ground_truth):
        batch_size = prediction.size(0)
        classes = prediction.size(1)
        prediction = prediction.float()
        ground_truth = ground_truth.float()
        intersection = prediction * ground_truth
        dice_numerator = 2.0 * intersection.view(batch_size, classes, -1).sum(-1)
        dice_denominator = prediction.view(batch_size, classes, -1).sum(-1) + \
                           ground_truth.view(batch_size, classes, -1).sum(-1) + self.eps
        dice = dice_numerator / dice_denominator
        return 1 - dice.mean()

视频示例:


滚去学习!