Skip to content

Commit

Permalink
tensorflow2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
czy36mengfei committed May 10, 2019
1 parent e864aa3 commit 21baf98
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions 003-keras_training_and_evaluation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# Training and evalution with keras"
"# TensorFlow2.0教程-使用keras训练模型"
]
},
{
Expand Down Expand Up @@ -485,7 +485,7 @@
"source": [
"# 增加第5类的权重\n",
"import numpy as np\n",
"# 样本权重\n",
"# 类权重\n",
"model = get_compiled_model()\n",
"class_weight = {i:1.0 for i in range(10)}\n",
"class_weight[5] = 2.0\n",
Expand All @@ -494,7 +494,7 @@
" class_weight=class_weight,\n",
" batch_size=64,\n",
" epochs=4)\n",
"# 类权重\n",
"# 样本权重\n",
"model = get_compiled_model()\n",
"sample_weight = np.ones(shape=(len(y_train),))\n",
"sample_weight[y_train == 5] = 2.0\n",
Expand Down

0 comments on commit 21baf98

Please sign in to comment.