def convnn(x, channels_num, layers_num, window_size=11):
    W_arr = []
    layers = []
    input_dimensions = x.get_shape().as_list()[1:]
    filter_shape = [window_size, input_dimensions[(- 1)], channels_num]
    W_input = weight_variable(filter_shape)
    W_arr.append(W_input)
    b_input = bias_variable([input_dimensions[0], channels_num])
    input_layer = tf.nn.relu((conv1d(x, W_input) + b_input))
    dropout_input = tf.nn.dropout(input_layer, keep_prob_input)
    layers.append(dropout_input)
    filter_shape = [window_size, channels_num, channels_num]
    W_hidden = tf.constant([], dtype=tf.float32)
    for i in range(layers_num):
        with tf.name_scope('conv'):
            W_hidden = weight_variable(filter_shape)
            W_arr.append(W_hidden)
            b_hidden = bias_variable([input_dimensions[0], channels_num])
            conv_layer = tf.nn.tanh(((alpha * conv1d(layers[i], W_hidden)) + b_hidden))
            tf.summary.histogram('weights', W_hidden)
            tf.summary.histogram('biases', b_hidden)
            tf.summary.histogram('activations', conv_layer)
        with tf.name_scope('dropout'):
            dropout = tf.nn.dropout(conv_layer, keep_prob)
            layers.append(dropout)
    (layer_out, W_out) = fc_layer(layers[(- 1)], channels_num, values_to_predict)
    W_arr.append(W_out)
    regularizers = ((tf.nn.l2_loss(W_input) + (tf.nn.l2_loss(W_hidden) * layers_num)) + tf.nn.l2_loss(W_out))
    return (layer_out, regularizers)
def convnn(x, channels_num, layers_num, window_size=11):
    W_arr = []
    layers = []
    input_dimensions = x.get_shape().as_list()[1:]
    filter_shape = [window_size, input_dimensions[(- 1)], channels_num]
    W_input = weight_variable(filter_shape)
    W_arr.append(W_input)
    b_input = bias_variable([input_dimensions[0], channels_num])
    input_layer = tf.nn.relu((conv1d(x, W_input) + b_input))
    dropout_input = tf.nn.dropout(input_layer, keep_prob_input)
    layers.append(dropout_input)
    filter_shape = [window_size, channels_num, channels_num]
    W_hidden = tf.constant([], dtype=tf.float32)
    for i in range(layers_num):
        with tf.name_scope('conv'):
            W_hidden = weight_variable(filter_shape)
            W_arr.append(W_hidden)
            b_hidden = bias_variable([input_dimensions[0], channels_num])
            conv_layer = tf.nn.tanh(((alpha * conv1d(layers[i], W_hidden)) + b_hidden))
            tf.summary.histogram('weights', W_hidden)
            tf.summary.histogram('biases', b_hidden)
            tf.summary.histogram('activations', conv_layer)
        with tf.name_scope('dropout'):
            dropout = tf.nn.dropout(conv_layer, keep_prob)
            layers.append(dropout)
    (layer_out, W_out) = fc_layer(layers[(- 1)], channels_num, values_to_predict)
    W_arr.append(W_out)
    regularizers = ((tf.nn.l2_loss(W_input) + (tf.nn.l2_loss(W_hidden) * layers_num)) + tf.nn.l2_loss(W_out))
    return (layer_out, regularizers)