Pytorch で RGB2GBR を実施
transpose は numpy の func なので、permute を使用する。
PyAVのインストールで詰まった
Transformer の pytorch での実装してるサイトのメモ
Label scaling と temperature scaling があり、予測結果のoverconfidence を抑制する。
.unsqueeze(1)
は縦長。scatter_で one-hot的に、置換している。
# true_dist.shape == (n, d) # target.shape == (n, ) true_dist.scatter_(1, target.data.unsqueeze(1), self.confidence)
[0, x / d, 1 / d, 1 / d, 1 / d]
は、multiclass の overconfidence を表現している。xが大きくなるにつれて overconfidenceする。
crit = LabelSmoothing(5, 0, 0.1) def loss(x): d = x + 3 * 1 predict = torch.FloatTensor([[0, x / d, 1 / d, 1 / d, 1 / d], ]) #print(predict) return crit(Variable(predict.log()), Variable(torch.LongTensor([1]))).data[0] plt.plot(np.arange(1, 100), [loss(x) for x in range(1, 100)]) None
- beam search の実装
The Two-Stage Least Squares Estimation(二段階最小二乗法)
操作変数法のアプローチの一つとして、二段階最小二乗法が存在している。これは、操作変数法の推定量の計算方法を代替することで、予測精度を上げることを期待している。
http://www3.grips.ac.jp/~yamanota/Lecture%20Note%208%20to%2010%202SLS%20&%20others.pdf
また、stage 1 の線形回帰については F統計量により、推定の強さを検定する。
category encoding について
category encoding をsklearn の BaseEstimator, TransformerMixin を利用して、作成されている。
binary encoding
bit 表現で one-hot encoding的な表現を作る。カラムの順序は value order でいい感じに調整できる。
BaseNEncoding
bit 表現(2進数)ではなくて、N進数表現している。