Visualisierung 2 CNN
convert_ckpt Namespace Reference

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)
 

Function Documentation

◆ get_activations()

def convert_ckpt.get_activations (   vis_ops)

◆ get_vis2_layers()

def convert_ckpt.get_vis2_layers (   vis_ops,
  weight_ops,
  weight_values 
)

◆ get_weights()

def convert_ckpt.get_weights (   trainable_ops)

Variable Documentation

◆ activation_values

convert_ckpt.activation_values = sess.run(get_activations(vis_ops))

◆ b_test

convert_ckpt.b_test = np.load('dataset/batch_test.npy')

◆ dataset_init_op

convert_ckpt.dataset_init_op = sess.graph.get_operation_by_name('dataset_init')

◆ dataset_test

convert_ckpt.dataset_test = tf.data.Dataset.from_tensor_slices((x_test, y_test)).repeat().shuffle(buffer_size=500).batch(1)

◆ json_base

def convert_ckpt.json_base = get_vis2_layers(vis_ops, weight_ops, weight_values)

◆ logits

convert_ckpt.logits = model.inference(features)

◆ new_saver

convert_ckpt.new_saver = tf.train.import_meta_graph('ckpt/model.ckpt-{}.meta'.format(i))

◆ train_ops

convert_ckpt.train_ops = tf.get_collection(tf.GraphKeys.TRAINABLE_VARIABLES)

◆ vis_ops

convert_ckpt.vis_ops = tf.get_collection('VisOps')

◆ weight_ops

def convert_ckpt.weight_ops = get_weights(train_ops)

◆ weight_values

convert_ckpt.weight_values = sess.run(weight_ops)

◆ x_test

convert_ckpt.x_test = b_test[:, 1:]

◆ y_test

convert_ckpt.y_test = b_test[:, 0]