(self, logits, labels, reg)
| 151 | plt.show() |
| 152 | |
| 153 | def get_cost(self, logits, labels, reg): |
| 154 | cost = tf.reduce_mean(tf.nn.sparse_softmax_cross_entropy_with_logits(logits, labels)) |
| 155 | rcost = sum(tf.nn.l2_loss(p) for p in self.params) |
| 156 | cost += reg*rcost |
| 157 | return cost |
| 158 | |
| 159 | # list_of_logits is an output! |
| 160 | # it is added to using post-order traversal |