Update RNN.ipynb

This commit is contained in:
tlk1997 2021-09-14 20:59:48 +08:00 committed by GitHub
parent a7fc2afdf8
commit 77d1f457e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 16 deletions

View File

@ -38,7 +38,7 @@
"metadata": {}
},
{
"cell_type": "code",
"cell_type": "python",
"execution_count": null,
"source": [
"# Run the neural network with pytorch and confirm whether it is installed before running\n",
@ -50,7 +50,7 @@
"metadata": {}
},
{
"cell_type": "code",
"cell_type": "python",
"execution_count": null,
"source": [
"# import the whole modules\n",
@ -77,7 +77,7 @@
"metadata": {}
},
{
"cell_type": "code",
"cell_type": "python",
"execution_count": null,
"source": [
"# Configuration file of model parameters\n",
@ -121,7 +121,7 @@
"metadata": {}
},
{
"cell_type": "code",
"cell_type": "python",
"execution_count": null,
"source": [
"# Word token builds a one hot dictionary, and then inputs it to the embedding layer to obtain the corresponding word information matrix\n",
@ -187,7 +187,7 @@
"metadata": {}
},
{
"cell_type": "code",
"cell_type": "python",
"execution_count": null,
"source": [
"# Functions required for preprocessing\n",
@ -280,7 +280,7 @@
"metadata": {}
},
{
"cell_type": "code",
"cell_type": "python",
"execution_count": null,
"source": [
"# Preprocess\n",
@ -349,7 +349,7 @@
"metadata": {}
},
{
"cell_type": "code",
"cell_type": "python",
"execution_count": null,
"source": [
"# pytorch construct Dataset\n",
@ -414,7 +414,7 @@
"metadata": {}
},
{
"cell_type": "code",
"cell_type": "python",
"execution_count": null,
"source": [
"# embedding layer\n",
@ -462,7 +462,7 @@
"metadata": {}
},
{
"cell_type": "code",
"cell_type": "python",
"execution_count": null,
"source": [
"# Gelu activation function, specified by transformer, works better than relu\n",
@ -477,7 +477,7 @@
"metadata": {}
},
{
"cell_type": "code",
"cell_type": "python",
"execution_count": null,
"source": [
"#rnn model\n",
@ -554,7 +554,7 @@
"metadata": {}
},
{
"cell_type": "code",
"cell_type": "python",
"execution_count": null,
"source": [
"# p,r,f1 measurement\n",
@ -586,7 +586,7 @@
"metadata": {}
},
{
"cell_type": "code",
"cell_type": "python",
"execution_count": null,
"source": [
"# Iteration in training process\n",
@ -652,7 +652,7 @@
"metadata": {}
},
{
"cell_type": "code",
"cell_type": "python",
"execution_count": null,
"source": [
"# Load dataset\n",
@ -668,7 +668,7 @@
"metadata": {}
},
{
"cell_type": "code",
"cell_type": "python",
"execution_count": null,
"source": [
"# After the preprocessed data is loaded, vocab_size is known\n",
@ -680,7 +680,7 @@
"metadata": {}
},
{
"cell_type": "code",
"cell_type": "python",
"execution_count": null,
"source": [
"# main entry, define optimization function, loss function and so on\n",
@ -758,4 +758,4 @@
},
"nbformat": 4,
"nbformat_minor": 2
}
}