fix rotation loss logic
"outputs": [],
"source": [
"def generator_loss(disc_generated_output, gen_output, target): \n",
- " rotation_target = target[2]\n",
- " rotation_predicted = gen_output[0,0,0,2]\n",
+ " rotation_target = target[2] * 90\n",
+ " rotation_predicted = gen_output[0,0,0,2] * 90\n",
" \n",
" diff_rotation = (rotation_target - rotation_predicted) % 180\n",
" diff_rotation = tf.reduce_min([diff_rotation, 180 - diff_rotation])\n",
- " reshaped_rotation_diff = tf.reshape(diff_rotation, (-1,))\n",
+ " reshaped_rotation_diff = tf.reshape(diff_rotation / 90, (-1,))\n",
" \n",
" positions_target = tf.concat((target[0:2], target[3::]), axis=0)\n",
" positions_predicted = tf.concat((gen_output[0,0,0,0:2], gen_output[0,0,0,3::]), axis=-1)\n",
"metadata": {},
"outputs": [],
"source": [
- "LAMBDA = 5\n",
- "EPOCHS = 1"
+ "LAMBDA = 1/30\n",
+ "EPOCHS = 150"
]
},
{
