# Path: deep_architect/contrib/misc/search_spaces/tensorflow/common.py
# def siso_tensorflow_module(name, compile_fn, name_to_hyperp, scope=None):
#     return htf.TensorflowModule(name, compile_fn, name_to_hyperp, ['in'],
#                                 ['out'], scope).get_io()
# 
# D = hp.Discrete


import deep_architect.modules as mo
import tensorflow as tf
import numpy as np
from deep_architect.contrib.misc.search_spaces.tensorflow.common import siso_tensorflow_module, D
            return {'out': tf.layers.dense(In, dh['num_hidden'])}

        return forward_fn

    return siso_tensorflow_module('AffineSimplified', compile_fn,
                                  {'num_hidden': h_num_hidden})


def nonlinearity(h_nonlin_name):

    def compile_fn(di, dh):

        def forward_fn(di):
            nonlin_name = dh['nonlin_name']
            if nonlin_name == 'relu':
                Out = tf.nn.relu(di['in'])
            elif nonlin_name == 'relu6':
                Out = tf.nn.relu6(di['in'])
            elif nonlin_name == 'crelu':
                Out = tf.nn.crelu(di['in'])
            elif nonlin_name == 'elu':
                Out = tf.nn.elu(di['in'])
            elif nonlin_name == 'softplus':
                Out = tf.nn.softplus(di['in'])
            else:
                raise ValueError
            return {"out": Out}

        return forward_fn


# Path: deep_architect/contrib/misc/search_spaces/tensorflow/common.py
# def siso_tensorflow_module(name, compile_fn, name_to_hyperp, scope=None):
#     return htf.TensorflowModule(name, compile_fn, name_to_hyperp, ['in'],
#                                 ['out'], scope).get_io()
# 
# D = hp.Discrete


# Path: deep_architect/contrib/misc/search_spaces/tensorflow/dnn.py
import deep_architect.modules as mo
import tensorflow as tf
import numpy as np
from deep_architect.contrib.misc.search_spaces.tensorflow.common import siso_tensorflow_module, D

            return {'out': tf.layers.dense(In, dh['num_hidden'])}

        return forward_fn

    return siso_tensorflow_module('AffineSimplified', compile_fn,
                                  {'num_hidden': h_num_hidden})


def nonlinearity(h_nonlin_name):

    def compile_fn(di, dh):

        def forward_fn(di):
            nonlin_name = dh['nonlin_name']
            if nonlin_name == 'relu':
                Out = tf.nn.relu(di['in'])
            elif nonlin_name == 'relu6':
                Out = tf.nn.relu6(di['in'])
            elif nonlin_name == 'crelu':
                Out = tf.nn.crelu(di['in'])
            elif nonlin_name == 'elu':
                Out = tf.nn.elu(di['in'])
            elif nonlin_name == 'softplus':
                Out = tf.nn.softplus(di['in'])
            else:
                raise ValueError
            return {"out": Out}

        return forward_fn


    return siso_tensorflow_module('Nonlinearity', compile_fn,