Skip to content

Commit

Permalink
set learning rate = 5e-4 (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
L-M-Sherlock committed Sep 26, 2022
1 parent d0b9b17 commit 4185f3d
Showing 1 changed file with 66 additions and 64 deletions.
130 changes: 66 additions & 64 deletions fsrs4anki_optimizer.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# FSRS4Anki v1.6.0 Optimizer"
"# FSRS4Anki v1.6.1 Optimizer"
]
},
{
Expand All @@ -13,8 +13,10 @@
"id": "lurCmW0Jqz3s"
},
"source": [
"Click the left button to open the optimizer on Google Colab: [![open in colab](https://colab.research.google.com/assets/colab-badge.svg)\n",
"](https://colab.research.google.com/github/open-spaced-repetition/fsrs4anki/blob/v1.6.0/fsrs4anki_optimizer.ipynb)\n",
"[![open in colab](https://colab.research.google.com/assets/colab-badge.svg)\n",
"](https://colab.research.google.com/github/open-spaced-repetition/fsrs4anki/blob/v1.6.1/fsrs4anki_optimizer.ipynb)\n",
"\n",
"↑ Click the above button to open the optimizer on Google Colab.\n",
"\n",
"> If you can't see the button and are located in the Chinese Mainland, please use a proxy or VPN."
]
Expand Down Expand Up @@ -161,7 +163,7 @@
"name": "stderr",
"output_type": "stream",
"text": [
"100%|██████████| 5166/5166 [00:16<00:00, 317.48it/s]\n"
"100%|██████████| 5166/5166 [00:19<00:00, 259.16it/s]\n"
]
},
{
Expand Down Expand Up @@ -410,7 +412,7 @@
"name": "stderr",
"output_type": "stream",
"text": [
"100%|██████████| 56910/56910 [00:03<00:00, 15572.48it/s]\n"
"100%|██████████| 56910/56910 [00:05<00:00, 11197.62it/s]\n"
]
},
{
Expand All @@ -424,177 +426,177 @@
"name": "stderr",
"output_type": "stream",
"text": [
"train: 0%|\u001b[31m \u001b[0m| 28/56910 [00:00<03:25, 277.11it/s]"
"train: 0%|\u001b[31m \u001b[0m| 23/56910 [00:00<04:21, 217.34it/s]"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"iteration: 1\n",
"f_s: [1.9999]\n",
"f_d: [4.9999]\n",
"s_w: [3.0001, -0.6999, -0.1999, 1.0001, -0.2999]\n"
"f_s: [1.9995]\n",
"f_d: [4.9995]\n",
"s_w: [3.0005, -0.6995, -0.1995, 1.0005, -0.2995]\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"train: 10%|\u001b[31m█ \u001b[0m| 5741/56910 [00:13<01:58, 432.54it/s]"
"train: 10%|\u001b[31m█ \u001b[0m| 5736/56910 [00:15<02:15, 376.60it/s]"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"iteration: 5692\n",
"f_s: [2.0368]\n",
"f_d: [4.9003]\n",
"s_w: [3.0831, -0.6272, -0.1495, 1.0813, -0.2776]\n"
"f_s: [2.1797]\n",
"f_d: [4.7475]\n",
"s_w: [3.1564, -0.5931, -0.1577, 1.1516, -0.1962]\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"train: 20%|\u001b[31m██ \u001b[0m| 11447/56910 [00:26<01:49, 416.76it/s]"
"train: 20%|\u001b[31m██ \u001b[0m| 11443/56910 [00:32<02:06, 360.29it/s]"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"iteration: 11383\n",
"f_s: [2.0937]\n",
"f_d: [4.8334]\n",
"s_w: [3.1344, -0.5846, -0.1229, 1.1321, -0.2554]\n"
"f_s: [2.4638]\n",
"f_d: [4.58]\n",
"s_w: [3.2334, -0.5603, -0.1446, 1.2244, -0.0923]\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"train: 30%|\u001b[31m███ \u001b[0m| 17140/56910 [00:41<01:32, 430.78it/s]"
"train: 30%|\u001b[31m███ \u001b[0m| 17132/56910 [00:49<01:51, 356.12it/s]"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"iteration: 17074\n",
"f_s: [2.1703]\n",
"f_d: [4.7928]\n",
"s_w: [3.1569, -0.5707, -0.1132, 1.1538, -0.217]\n"
"f_s: [2.7116]\n",
"f_d: [4.4666]\n",
"s_w: [3.2372, -0.6064, -0.1444, 1.2241, -0.0266]\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"train: 40%|\u001b[31m████ \u001b[0m| 22819/56910 [00:57<01:49, 312.71it/s]"
"train: 40%|\u001b[31m████ \u001b[0m| 22824/56910 [01:05<01:35, 358.35it/s]"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"iteration: 22765\n",
"f_s: [2.2089]\n",
"f_d: [4.7729]\n",
"s_w: [3.1608, -0.5745, -0.124, 1.1582, -0.2007]\n"
"f_s: [2.7986]\n",
"f_d: [4.3917]\n",
"s_w: [3.2168, -0.6731, -0.1813, 1.2032, -0.0937]\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"train: 50%|\u001b[31m█████ \u001b[0m| 28501/56910 [01:13<01:14, 382.50it/s]"
"train: 50%|\u001b[31m█████ \u001b[0m| 28503/56910 [01:21<01:14, 381.29it/s]"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"iteration: 28456\n",
"f_s: [2.2952]\n",
"f_d: [4.7431]\n",
"s_w: [3.1684, -0.5774, -0.1244, 1.1653, -0.1583]\n"
"f_s: [3.0414]\n",
"f_d: [4.2301]\n",
"s_w: [3.2537, -0.699, -0.1432, 1.239, -0.0163]\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"train: 60%|\u001b[31m██████ \u001b[0m| 34235/56910 [01:27<00:51, 437.34it/s]"
"train: 60%|\u001b[31m██████ \u001b[0m| 34188/56910 [01:36<01:11, 318.79it/s]"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"iteration: 34147\n",
"f_s: [2.355]\n",
"f_d: [4.7151]\n",
"s_w: [3.1764, -0.5792, -0.1272, 1.1735, -0.1324]\n"
"f_s: [3.1691]\n",
"f_d: [4.1022]\n",
"s_w: [3.274, -0.7348, -0.1389, 1.2619, -0.0539]\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"train: 70%|\u001b[31m███████ \u001b[0m| 39905/56910 [01:42<00:43, 394.01it/s]"
"train: 70%|\u001b[31m███████ \u001b[0m| 39865/56910 [01:52<00:43, 388.11it/s]"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"iteration: 39838\n",
"f_s: [2.4223]\n",
"f_d: [4.6897]\n",
"s_w: [3.1866, -0.5763, -0.1261, 1.183, -0.1039]\n"
"f_s: [3.3469]\n",
"f_d: [3.9956]\n",
"s_w: [3.3068, -0.7387, -0.1171, 1.2897, -0.0293]\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"train: 80%|\u001b[31m████████ \u001b[0m| 45564/56910 [01:57<00:29, 380.48it/s]"
"train: 80%|\u001b[31m████████ \u001b[0m| 45587/56910 [02:10<00:31, 356.60it/s]"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"iteration: 45529\n",
"f_s: [2.4681]\n",
"f_d: [4.6696]\n",
"s_w: [3.1863, -0.5861, -0.134, 1.182, -0.0845]\n"
"f_s: [3.4565]\n",
"f_d: [3.9056]\n",
"s_w: [3.2928, -0.8047, -0.1339, 1.2717, -0.0383]\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"train: 90%|\u001b[31m█████████ \u001b[0m| 51229/56910 [02:12<00:19, 284.91it/s]"
"train: 90%|\u001b[31m█████████ \u001b[0m| 51263/56910 [02:28<00:17, 314.70it/s]"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"iteration: 51220\n",
"f_s: [2.5161]\n",
"f_d: [4.6479]\n",
"s_w: [3.1876, -0.5955, -0.1401, 1.1829, -0.0692]\n"
"f_s: [3.537]\n",
"f_d: [3.7962]\n",
"s_w: [3.3122, -0.8387, -0.1291, 1.2886, -0.0559]\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"train: 100%|\u001b[31m██████████\u001b[0m| 56910/56910 [02:27<00:00, 385.32it/s]"
"train: 100%|\u001b[31m██████████\u001b[0m| 56910/56910 [02:42<00:00, 349.66it/s]"
]
},
{
Expand All @@ -616,7 +618,7 @@
"source": [
"model = FSRS()\n",
"clipper = WeightClipper()\n",
"optimizer = torch.optim.Adam(model.parameters(), lr=1e-4, weight_decay=1e-5)\n",
"optimizer = torch.optim.Adam(model.parameters(), lr=5e-4, weight_decay=1e-5)\n",
"\n",
"dataset = pd.read_csv(\"./revlog_history.tsv\", sep='\\t', index_col=None)\n",
"dataset = dataset[(dataset['i'] > 1) & (dataset['delta_t'] > 0)]\n",
Expand Down Expand Up @@ -702,13 +704,13 @@
"name": "stdout",
"output_type": "stream",
"text": [
"let defaultDifficulty = 4.6179;\n",
"let defaultStability = 2.5636;\n",
"let difficultyDecay = -0.5913;\n",
"let stabilityDecay = -0.1382;\n",
"let retrievabilityFactor = 1.1951;\n",
"let increaseFactor = 3.201;\n",
"let lapsesBase = -0.0562;\n"
"let defaultDifficulty = 3.6878;\n",
"let defaultStability = 3.6366;\n",
"let difficultyDecay = -0.8361;\n",
"let stabilityDecay = -0.1132;\n",
"let retrievabilityFactor = 1.3274;\n",
"let increaseFactor = 3.3573;\n",
"let lapsesBase = -0.047;\n"
]
}
],
Expand Down Expand Up @@ -750,23 +752,23 @@
"\n",
"first rating: 1\n",
"rating history: 1,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3\n",
"interval history: 0,1,2,4,7,12,21,35,57,90,139,211,313,457,657,929\n",
"difficulty history: 0,6.6,6.6,6.6,6.5,6.5,6.5,6.5,6.5,6.5,6.5,6.5,6.5,6.5,6.5,6.5\n",
"interval history: 0,1,2,4,7,12,21,35,57,91,142,219,331,493,723,1047\n",
"difficulty history: 0,5.7,5.7,5.7,5.7,5.7,5.7,5.7,5.7,5.7,5.7,5.7,5.7,5.7,5.7,5.7\n",
"\n",
"first rating: 2\n",
"rating history: 2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3\n",
"interval history: 0,1,2,4,8,15,26,44,73,118,185,285,429,635,923,1321\n",
"difficulty history: 0,5.6,5.6,5.7,5.7,5.7,5.7,5.7,5.7,5.7,5.7,5.7,5.7,5.7,5.7,5.7\n",
"interval history: 0,2,4,8,15,27,47,81,135,221,353,554,853,1291,1924,2826\n",
"difficulty history: 0,4.7,4.7,4.7,4.7,4.7,4.7,4.7,4.7,4.7,4.7,4.7,4.7,4.7,4.7,4.7\n",
"\n",
"first rating: 3\n",
"rating history: 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3\n",
"interval history: 0,3,6,12,22,40,70,119,196,314,491,751,1127,1660,2404,3427\n",
"difficulty history: 0,4.6,4.6,4.6,4.6,4.6,4.6,4.6,4.6,4.6,4.6,4.6,4.6,4.6,4.6,4.6\n",
"interval history: 0,4,8,17,33,63,116,207,358,605,998,1610,2545,3949,6022,9035\n",
"difficulty history: 0,3.7,3.7,3.7,3.7,3.7,3.7,3.7,3.7,3.7,3.7,3.7,3.7,3.7,3.7,3.7\n",
"\n",
"first rating: 4\n",
"rating history: 4,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3\n",
"interval history: 0,5,11,22,43,79,141,243,406,660,1046,1620,2456,3653,5339,7676\n",
"difficulty history: 0,3.6,3.6,3.6,3.6,3.6,3.6,3.6,3.6,3.6,3.6,3.6,3.6,3.6,3.6,3.6\n",
"interval history: 0,7,17,38,82,168,330,626,1148,2041,3528,5945,9784,15756,24867,38523\n",
"difficulty history: 0,2.7,2.7,2.7,2.7,2.7,2.7,2.7,2.7,2.7,2.7,2.7,2.7,2.7,2.7,2.7\n",
"\n"
]
}
Expand Down Expand Up @@ -828,8 +830,8 @@
"output_type": "stream",
"text": [
"rating history: 3,3,3,2,3,4,3,3,1,3,3,3\n",
"interval history: 0,3,6,12,14,33,74,113,192,3,6,11,21\n",
"difficulty history: 0,4.6,4.6,4.6,5.1,5.1,4.1,4.1,4.1,4.9,4.8,4.8,4.8\n"
"interval history: 0,4,8,17,20,49,113,189,347,4,8,16,31\n",
"difficulty history: 0,3.7,3.7,3.7,4.2,4.2,3.2,3.2,3.2,3.9,3.9,3.9,3.9\n"
]
}
],
Expand Down

0 comments on commit 4185f3d

Please sign in to comment.