Closed gzzyyxh closed 7 months ago
在这个位置:
loss_fn = torch.nn.CrossEntropyLoss(ignore_index=data_loader.PAD_IDX) optimizer = torch.optim.Adam(translation_model.parameters(), lr=0., betas=(config.beta1, config.beta2), eps=config.epsilon)
https://github.com/moon-hotel/TransformerTranslation/blob/b265526093d4c96fc859dde0c5cfebda94dd1563/train.py#L106
源码里就是用的这个,不是0,你给的只是初始化的值
在这个位置: