start new:
tmux
start new with session name:
tmux new -s myname
| import tensorflow as tf | |
| from tensorflow.python.client import timeline | |
| a = tf.random_normal([2000, 5000]) | |
| b = tf.random_normal([5000, 1000]) | |
| res = tf.matmul(a, b) | |
| with tf.Session() as sess: | |
| # add additional options to trace the session execution | |
| options = tf.RunOptions(trace_level=tf.RunOptions.FULL_TRACE) |
| import tensorflow as tf | |
| class MultithreadedTensorProvider(): | |
| """ A class designed to provide tensors input in a | |
| separate threads. """ | |
| def __init__(self, capacity, sess, dtypes, shuffle_queue=False, | |
| number_of_threads=1): |
| def composite_function(self, _input, out_features, kernel_size=3): | |
| """Function from paper H_l that performs: | |
| - batch normalization | |
| - ReLU nonlinearity | |
| - convolution with required kernel | |
| - dropout, if required | |
| """ | |
| with tf.variable_scope("composite_function"): | |
| # BN | |
| output = self.batch_norm(_input) |
| import json | |
| import tensorflow as tf | |
| from tensorflow.python.client import timeline | |
| x = tf.random_normal([1000, 1000]) | |
| y = tf.random_normal([1000, 1000]) | |
| res = tf.matmul(x, y) | |
| # Run the graph with full trace option |
| import hashlib | |
| import argparse | |
| import subprocess | |
| parser = argparse.ArgumentParser() | |
| parser.add_argument('--md5', type=str, required=True) | |
| args = parser.parse_args() | |
| script_to_run = 'some.py' |
| def mi_linear(arg1, arg2, output_size, global_bias_start=0.0, scope=None): | |
| """Multiplicated Integrated Linear map: | |
| See http://arxiv.org/pdf/1606.06630v1.pdf | |
| A * (W[0] * arg1) * (W[1] * arg2) + (W[0] * arg1 * bias1) + (W[1] * arg2 * bias2) + global_bias. | |
| Args: | |
| arg1: batch x n, Tensor. | |
| arg2: batch x n, Tensor. | |
| output_size: int, second dimension of W[i]. | |
| global_bias_start: starting value to initialize the global bias; 0 by default. | |
| scope: VariableScope for the created subgraph; defaults to "MILinear". |