Visualisierung 2 CNN
|
Functions | |
def | get_weights (trainable_ops) |
def | get_activations (vis_ops) |
def | get_vis2_layers (vis_ops, weight_ops, weight_values) |
Variables | |
b_test = np.load('dataset/batch_test.npy') | |
x_test = b_test[:, 1:] | |
y_test = b_test[:, 0] | |
dataset_test = tf.data.Dataset.from_tensor_slices((x_test, y_test)).repeat().shuffle(buffer_size=500).batch(1) | |
new_saver = tf.train.import_meta_graph('ckpt/model.ckpt-{}.meta'.format(i)) | |
dataset_init_op = sess.graph.get_operation_by_name('dataset_init') | |
logits = model.inference(features) | |
vis_ops = tf.get_collection('VisOps') | |
train_ops = tf.get_collection(tf.GraphKeys.TRAINABLE_VARIABLES) | |
def | weight_ops = get_weights(train_ops) |
weight_values = sess.run(weight_ops) | |
activation_values = sess.run(get_activations(vis_ops)) | |
def | json_base = get_vis2_layers(vis_ops, weight_ops, weight_values) |
def convert_ckpt.get_activations | ( | vis_ops | ) |
def convert_ckpt.get_vis2_layers | ( | vis_ops, | |
weight_ops, | |||
weight_values | |||
) |
def convert_ckpt.get_weights | ( | trainable_ops | ) |
convert_ckpt.activation_values = sess.run(get_activations(vis_ops)) |
convert_ckpt.b_test = np.load('dataset/batch_test.npy') |
convert_ckpt.dataset_init_op = sess.graph.get_operation_by_name('dataset_init') |
convert_ckpt.dataset_test = tf.data.Dataset.from_tensor_slices((x_test, y_test)).repeat().shuffle(buffer_size=500).batch(1) |
def convert_ckpt.json_base = get_vis2_layers(vis_ops, weight_ops, weight_values) |
convert_ckpt.logits = model.inference(features) |
convert_ckpt.new_saver = tf.train.import_meta_graph('ckpt/model.ckpt-{}.meta'.format(i)) |
convert_ckpt.train_ops = tf.get_collection(tf.GraphKeys.TRAINABLE_VARIABLES) |
convert_ckpt.vis_ops = tf.get_collection('VisOps') |
def convert_ckpt.weight_ops = get_weights(train_ops) |
convert_ckpt.weight_values = sess.run(weight_ops) |
convert_ckpt.x_test = b_test[:, 1:] |
convert_ckpt.y_test = b_test[:, 0] |