提示:记录下深度学习的小tips
文章目录
前言
2022 五月 19日:
训练模型的optimizer epoch learning rate 设置
一、optimizer
For patient data, the model used an FC layer (FCother in figure 1) to obtain the preclassification score for AD. The combined result was obtained by averaging the preclassification AD scores from the retinal images (UWF colour, UWF FAF, GC-IPL maps and OCTA) with OCT and OCTA quantitative data and patient data and scaled to the [0, 1] probability range using a sigmoid function26 (figure 1). The model is trained to maximise binary cross-entropy loss (ie, the likelihood that multimodal inputs are correctly assigned to either the AD or control group).
1.PyTorch Adam optimizer
2.100 epochs
3.learning rate
initial learning rate of 0.01 for FC layers, and 0.0001 for other layers where parameters are initialised by the pretrained ResNet18.
learning decay
A decay of 0.5 is applied to the learning rates every 10 epochs.
4.regularisation loss
We tested different weights from 0.001 to 10 for regularisation loss and found that 0.01 worked best.
5.train split into train and validation
validation loss 也要画出来
6.epoch 100
epoch 100算比较小的 因为数据集小, 防止over fitting。
二、plot
1.换颜色
cmap="rainbow":彩虹色
2.换scale
vmin=0.3, vmax=0.75