python argparser
1 | import argparse |
定位参数 ‘config’
不用加-, 是普通的参数列表
可选参数 ‘-t’/‘–threads’
需要加-, 需要加参数名字的参数列表
1 | import argparse |
不用加-, 是普通的参数列表
需要加-, 需要加参数名字的参数列表
1 | import torch |
要应该拼接起来
1 | y2 = torch.cat([ |
“—
title: 人脸识别的loss
date: 2018-08-16 17:42:27
tags:
—“


soft max比hard max更容易达到终极目标one-hot形式, 因为它大的会被放大
softmax鼓励不同类别的特征分开,但并不鼓励特征分离很多
(5,1,1,1)时loss就已经很小了,此时CNN接近收敛梯度不再下降
1 | out[out > 0] = 1 |
As your function’s derivative is 0 everywhere (except for the input 0, where it isn’t smooth), you can also implement it as a function:
pytorch 在backward的时候会删除计算图,
所以在backward的时候要加入参数 loss.backward(retain_graph=True)
输出的loss需要是一个值loss.sum().backward()
1 | subprocess.call(cmd, shell=True, stdout=fp, executable="/bin/zsh") |
1 | echo 'one two three' | xargs -t rm |