目录
1.实验背景与需求分析 ..............................................................................................................5
1.1 实验背景 .......................................................................................................................5
1.2 需求分析 .......................................................................................................................5
1.3 实验环境 .......................................................................................................................5
2. 解决方案和关键代码实现...................................................................................................6
2.1 数据预处理...................................................................................................................6
2.2 数据读取 .......................................................................................................................6
2.3 词位置编码...................................................................................................................7
2.4 Transformer 模型.........................................................................................................8
2.4.1 embedding 层..................................................................................................9
2.4.2 positional_encoding 层 .................................................................................9
2.4.3 Multi-head attention 层 .............................................................................10
2.4.4 全连接层 ........................................................................................................12
2.5 模型评价.....................................................................................................................13
2.6 模型训练与预测 .......................................................................................................13
2.7 实验结果.....................................................................................................................14
3. 问题解决 ................................................................................................................................14
4.实验结论...................................................................................................................................15
评论0
最新资源