def create_mlp_node(node): node.add_op(Identity()) node.add_op(Dense(100, tf.nn.relu)) node.add_op(Dense(100, tf.nn.tanh)) node.add_op(Dense(100, tf.nn.sigmoid)) node.add_op(Dropout(0.05)) node.add_op(Dense(500, tf.nn.relu)) node.add_op(Dense(500, tf.nn.tanh)) node.add_op(Dense(500, tf.nn.sigmoid)) node.add_op(Dropout(0.1)) node.add_op(Dense(1000, tf.nn.relu)) node.add_op(Dense(1000, tf.nn.tanh)) node.add_op(Dense(1000, tf.nn.sigmoid)) node.add_op(Dropout(0.2))
def add_mlp_op_(node): node.add_op(Identity()) node.add_op(Dense(100, tf.nn.relu)) node.add_op(Dense(100, tf.nn.tanh)) node.add_op(Dense(100, tf.nn.sigmoid)) node.add_op(Dropout(0.3)) node.add_op(Dense(500, tf.nn.relu)) node.add_op(Dense(500, tf.nn.tanh)) node.add_op(Dense(500, tf.nn.sigmoid)) node.add_op(Dropout(0.4)) node.add_op(Dense(1000, tf.nn.relu)) node.add_op(Dense(1000, tf.nn.tanh)) node.add_op(Dense(1000, tf.nn.sigmoid)) node.add_op(Dropout(0.5))
def add_mlp_ops_to(vnode): # REG_L1 = 1. # REG_L2 = 1. vnode.add_op(Identity()) vnode.add_op(Dense(100, tf.nn.relu)) vnode.add_op(Dense(100, tf.nn.tanh)) vnode.add_op(Dense(100, tf.nn.sigmoid)) vnode.add_op(Dropout(0.05)) vnode.add_op(Dense(500, tf.nn.relu)) vnode.add_op(Dense(500, tf.nn.tanh)) vnode.add_op(Dense(500, tf.nn.sigmoid)) vnode.add_op(Dropout(0.1)) vnode.add_op(Dense(1000, tf.nn.relu)) vnode.add_op(Dense(1000, tf.nn.tanh)) vnode.add_op(Dense(1000, tf.nn.sigmoid)) vnode.add_op(Dropout(0.2))
def create_mlp_node(name): n = VariableNode(name) n.add_op(Identity()) n.add_op(Dense(100, tf.nn.relu)) n.add_op(Dense(100, tf.nn.tanh)) n.add_op(Dense(100, tf.nn.sigmoid)) n.add_op(Dropout(0.05)) n.add_op(Dense(500, tf.nn.relu)) n.add_op(Dense(500, tf.nn.tanh)) n.add_op(Dense(500, tf.nn.sigmoid)) n.add_op(Dropout(0.1)) n.add_op(Dense(1000, tf.nn.relu)) n.add_op(Dense(1000, tf.nn.tanh)) n.add_op(Dense(1000, tf.nn.sigmoid)) n.add_op(Dropout(0.2)) return n
def create_structure(input_shape=(2, ), output_shape=(1, ), *args, **kwargs): struct = AutoOutputStructure(input_shape, output_shape, regression=False) n1 = ConstantNode(op=Conv1D(filter_size=20, num_filters=128), name='N') struct.connect(struct.input_nodes[0], n1) n2 = ConstantNode(op=Activation(activation='relu'), name='N') struct.connect(n1, n2) n3 = ConstantNode(op=MaxPooling1D(pool_size=1, padding='same'), name='N') struct.connect(n2, n3) n4 = ConstantNode(op=Conv1D(filter_size=10, num_filters=128), name='N') struct.connect(n3, n4) n5 = ConstantNode(op=Activation(activation='relu'), name='N') struct.connect(n4, n5) n6 = ConstantNode(op=MaxPooling1D(pool_size=10, padding='same'), name='N') struct.connect(n5, n6) n7 = ConstantNode(op=Flatten(), name='N') struct.connect(n6, n7) n8 = ConstantNode(op=Dense(units=200), name='N') struct.connect(n7, n8) n9 = ConstantNode(op=Activation(activation='relu'), name='N') struct.connect(n8, n9) n10 = ConstantNode(op=Dropout(rate=0.1), name='N') struct.connect(n9, n10) n11 = ConstantNode(op=Dense(units=20), name='N') struct.connect(n10, n11) n12 = ConstantNode(op=Activation(activation='relu'), name='N') struct.connect(n11, n12) n13 = ConstantNode(op=Dropout(rate=0.1), name='N') struct.connect(n12, n13) return struct
def add_dropout_op_(node): node.add_op(Identity()) node.add_op(Dropout(rate=0.5)) node.add_op(Dropout(rate=0.4)) node.add_op(Dropout(rate=0.3)) node.add_op(Dropout(rate=0.2)) node.add_op(Dropout(rate=0.1)) node.add_op(Dropout(rate=0.05))