<commit_before>import numpy as np
import tensorflow as tf


def flatten(x_tensor):
    flat_dim = np.prod(x_tensor.get_shape().as_list()[1:])
    return tf.reshape(x_tensor, shape=(-1,flat_dim))


def fully_conn(x_tensor, num_outputs):
    weights = tf.Variable(tf.truncated_normal(
                    [x_tensor.get_shape().as_list()[1],num_outputs],
                    stddev=0.1))
    biases = tf.Variable(tf.constant(0.0, shape=[num_outputs]))
    return tf.nn.relu(tf.matmul(x_tensor,weights) + biases)


def output(x_tensor, num_outputs):
    weights = tf.Variable(tf.truncated_normal(
                    [x_tensor.get_shape().as_list()[1],num_outputs],
                    stddev=0.1))
    biases = tf.Variable(tf.constant(0.0, shape=[num_outputs]))
    return tf.matmul(x_tensor,weights) + biases


def conv2d(x_tensor, conv_num_outputs, conv_ksize, conv_strides):
    weights = tf.Variable(tf.truncated_normal(
                    [conv_ksize[0],conv_ksize[1],x_tensor.get_shape().as_list()[3],conv_num_outputs],
                    stddev=0.1))
    biases = tf.Variable(tf.constant(0.0, shape=[conv_num_outputs]))
    x = tf.nn.conv2d(x_tensor, weights, [1,conv_strides[0],conv_strides[1],1], padding='SAME')
    return tf.nn.relu(x+biases)


def conv2d_maxpool(x_tensor, conv_num_outputs, conv_ksize, conv_strides, pool_ksize, pool_strides):
    weights = tf.Variable(tf.truncated_normal(
                    [conv_ksize[0],conv_ksize[1],x_tensor.get_shape().as_list()[3],conv_num_outputs],
                    stddev=0.1))
    biases = tf.Variable(tf.constant(0.0, shape=[conv_num_outputs]))
    x = tf.nn.conv2d(x_tensor, weights, [1,conv_strides[0],conv_strides[1],1], padding='SAME')
    x = tf.nn.relu(x+biases)

    x = tf.nn.max_pool(x, [1, pool_ksize[0], pool_ksize[1], 1], [1, pool_strides[0], pool_strides[1], 1], padding='SAME')
    return x



# Placeholders for model inputs, outputs and dropout rates
x = tf.placeholder(tf.float32, shape=[None,66,200,3])
y_ = tf.placeholder(tf.float32, shape=[None,1])

keep_prob = tf.placeholder(tf.float32)
<commit_msg>typo/formatting<commit_after>import numpy as np
import tensorflow as tf


def flatten(x_tensor):
    flat_dim = np.prod(x_tensor.get_shape().as_list()[1:])
    return tf.reshape(x_tensor, shape=(-1,flat_dim))

def fully_conn(x_tensor, num_outputs):
    weights = tf.Variable(tf.truncated_normal(
                    [x_tensor.get_shape().as_list()[1],num_outputs],
                    stddev=0.1))
    biases = tf.Variable(tf.constant(0.0, shape=[num_outputs]))
    return tf.nn.relu(tf.matmul(x_tensor,weights) + biases)

def output(x_tensor, num_outputs):
    weights = tf.Variable(tf.truncated_normal(
                    [x_tensor.get_shape().as_list()[1],num_outputs],
                    stddev=0.1))
    biases = tf.Variable(tf.constant(0.0, shape=[num_outputs]))
    return tf.matmul(x_tensor,weights) + biases

def conv2d(x_tensor, conv_num_outputs, conv_ksize, conv_strides):
    weights = tf.Variable(tf.truncated_normal(
                    [conv_ksize[0],conv_ksize[1],x_tensor.get_shape().as_list()[3],conv_num_outputs],
                    stddev=0.1))
    biases = tf.Variable(tf.constant(0.0, shape=[conv_num_outputs]))
    x = tf.nn.conv2d(x_tensor, weights, [1,conv_strides[0],conv_strides[1],1], padding='SAME')
    return tf.nn.relu(x+biases)

def conv2d_maxpool(x_tensor, conv_num_outputs, conv_ksize, conv_strides, pool_ksize, pool_strides):
    weights = tf.Variable(tf.truncated_normal(
                    [conv_ksize[0],conv_ksize[1],x_tensor.get_shape().as_list()[3],conv_num_outputs],
                    stddev=0.1))
    biases = tf.Variable(tf.constant(0.0, shape=[conv_num_outputs]))
    x = tf.nn.conv2d(x_tensor, weights, [1,conv_strides[0],conv_strides[1],1], padding='SAME')
    x = tf.nn.relu(x+biases)

    x = tf.nn.max_pool(x, [1, pool_ksize[0], pool_ksize[1], 1], [1, pool_strides[0], pool_strides[1], 1], padding='SAME')
    return x

# Placeholders for model inputs, outputs and dropout rates
x = tf.placeholder(tf.float32, shape=[None,66,200,3])
y_ = tf.placeholder(tf.float32, shape=[None,1])

keep_prob = tf.placeholder(tf.float32)

{'fraction_non_alphanumeric': 0.15264423076923078, 'fraction_numerical': 0.028365384615384615, 'mean_word_length': 3.8271461716937356, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3149763', 'n_tokens_mistral': 1587, 'n_tokens_neox': 1532, 'n_words': 220}