Skip to content

Commit

Permalink
Update train_cnn.ipynb
Browse files Browse the repository at this point in the history
Call model.merge_bn() if available
  • Loading branch information
QueensGambit committed Sep 24, 2024
1 parent 8737baf commit 36582c6
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion DeepCrazyhouse/src/training/train_cnn.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1145,6 +1145,29 @@
"print('best val_loss: %.5f with v_policy_acc: %.5f at k_steps_best %d' % (val_loss_best, val_p_acc_best, k_steps_best))"
]
},
{
"cell_type": "markdown",
"source": [
"## Merge Batchnorm layers (if possible)\n",
"\n",
"This is required for the AlphaVile networks that use the Next Transformer Block (NTB)."
],
"metadata": {
"collapsed": false
}
},
{
"cell_type": "code",
"execution_count": null,
"outputs": [],
"source": [
"if hasattr(model, \"merge_bn\"):\n",
" model.merge_bn()"
],
"metadata": {
"collapsed": false
}
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down Expand Up @@ -1715,4 +1738,4 @@
},
"nbformat": 4,
"nbformat_minor": 4
}
}

0 comments on commit 36582c6

Please sign in to comment.