你好!这是《当代人工智能》课程实验五的作业仓库😊(请参考master分支噢!!)
此代码使用版本为3.10.6的python语言实现,同时需要用如下命令安装相应模块:
pip install -r requirements.txt
本仓库由如下所示的文件和文件夹组成:
|-- lab5.py #code for this project
|-- 实验五数据 # a file folder for the data this lab needs(.zip version)
|-- data/ # including text data and image data for this project
|-- test_without_label.txt # the file we need to test by model
|-- train.txt # the file used to train our model
|-- requirements.txt # including all the python modules needed
|-- readme.md # introducing this repository
##代码执行流程
- 把本仓库的所有文件下载到一个名为AI_lab5的大文件夹下,并进入:
cd AI_lab5
- 确保自己的python版本在3.10.6左右,并下载所需模块:
python --version
pip install -r requirements.txt
- 用类似如下的语句运行模型,可自行调整命令行参数(此处假设AI_lab5文件夹直接下载到C盘):
python lab5.py --epochs 10 --batch_size 16 --learning_rate 1e-5 --data_path r"C:\AI_lab5\实验五数据\data" --train_file r"C:\AI_lab5\实验五数据\train.txt" --test_file r"C:\AI_lab5\实验五数据\test_without_label.txt"
- 观察实验结果即可
本代码主要参考了如下两个对数据进行处理的库: