Skip to content

Commit

Permalink
add tempfile
Browse files Browse the repository at this point in the history
  • Loading branch information
duoergun0729 committed Sep 12, 2018
1 parent 03296d1 commit a374fc2
Showing 1 changed file with 23 additions and 5 deletions.
28 changes: 23 additions & 5 deletions tutorials/imagenet_tutorial_fgsm_tf.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ def create_graph(dirname):
create_graph(dirname)

# 初始化参数 非常重要


session.run(tf.global_variables_initializer())

#tensorlist=[n.name for n in session.graph_def.node]
Expand Down Expand Up @@ -86,16 +88,32 @@ def create_graph(dirname):
#print(g)
#print(logits)
#print(softmax)
#logits = session.run(logits, feed_dict={x: image_data})
#print(logits)
g = session.run(logits, feed_dict={x: image_data})
print(g)

g = session.run(softmax, feed_dict={x: image_data})
print(g)
#tf.gradients(tf.nn.softmax(self._logits)[:, label], self._input_ph)[0]
g = tf.gradients(logits[:, 1], x)[0]
#print(logits[:, 1])
g = tf.gradients(logits, x)
print(g)

g = tf.gradients(softmax, x)
print(g)

z=tf.placeholder(tf.int64, None)
z=2*y

g = tf.gradients(z, y)
print(g)


grads = session.run(g, feed_dict={x: image_data})

print(grads)


#grads = session.run(g, feed_dict={x: image_data})

#print(grads)



Expand Down

0 comments on commit a374fc2

Please sign in to comment.