How to use the deephyper.search.nas.model.space.node.VariableNode function in deephyper

To help you get started, we’ve selected a few deephyper examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github deephyper / deephyper / tests / deephyper / search / nas / model / space / test_auto_output_structure.py View on Github external
def test_create_one_vnode(self):
        from deephyper.search.nas.model.space.struct import AutoOutputStructure
        struct = AutoOutputStructure((5, ), (1, ))

        from deephyper.search.nas.model.space.node import VariableNode
        vnode = VariableNode()

        struct.connect(struct.input_nodes[0], vnode)

        from deephyper.search.nas.model.space.op.op1d import Dense
        vnode.add_op(Dense(10))

        struct.set_ops([0])

        falias = 'test_direct_structure'
        struct.draw_graphviz(f'{falias}.dot')

        model = struct.create_model()
        from tensorflow.keras.utils import plot_model

        plot_model(model, to_file=f'{falias}.png', show_shapes=True)
github deephyper / deephyper / tests / deephyper / search / nas / model / space / test_direct_structure.py View on Github external
def test_create_one_vnode(self):
        from deephyper.search.nas.model.space.struct import DirectStructure
        struct = DirectStructure((5, ), (1, ))

        from deephyper.search.nas.model.space.node import VariableNode
        vnode = VariableNode()

        struct.connect(struct.input_nodes[0], vnode)

        from deephyper.search.nas.model.space.op.op1d import Dense
        vnode.add_op(Dense(1))

        struct.set_ops([0])

        falias = 'test_direct_structure'
        struct.draw_graphviz(f'{falias}.dot')

        model = struct.create_model()
        from tensorflow.keras.utils import plot_model

        plot_model(model, to_file=f'{falias}.png', show_shapes=True)
github deephyper / deephyper / deephyper / search / nas / model / space / nx_search_space.py View on Github external
        for n in filter(lambda n: isinstance(n, VariableNode), self.nodes):
            if n.num_ops != 0:
github deephyper / deephyper / deephyper / search / nas / model / baseline / simple.py View on Github external
def create_structure(input_shape=(2,), output_shape=(1,), **kwargs):
    struct = AutoOutputStructure(input_shape, output_shape, regression=True)

    vnode1 = VariableNode()
    for i in range(1, 11):
        vnode1.add_op(Dense(i, tf.nn.relu))

    struct.connect(struct.input_nodes[0], vnode1)

    return struct
github deephyper / deephyper / deephyper / search / nas / model / baseline / simple_bi_model.py View on Github external
for i in range(16, 129, 16):
            vnode.add_op(Dense(i, tf.nn.relu))

        struct.connect(prev_node, vnode)
        prev_node = vnode

    out1 = ConstantNode(op=Dense(1, name="output_0"))
    struct.connect(prev_node, out1)

    # auto-encoder
    # units = [128, 64, 32, 16, 8, 16, 32, 64, 128]
    units = [32, 16, 32]
    prev_node = inp
    d = 1
    for i in range(len(units)):
        vnode = VariableNode()
        # vnode.add_op(Identity)
        if d == 1 and units[i] < units[i + 1]:
            d = -1
            # print(min(1, units[i]), ' - ', max(1, units[i])+1)
            for u in range(min(2, units[i], 2), max(2, units[i]) + 1, 2):
                vnode.add_op(Dense(u, tf.nn.relu))
            latente_space = vnode
        else:
            # print(min(units[i], units[i+d]), ' - ', max(units[i], units[i+d])+1)
            for u in range(
                min(units[i], units[i + d]), max(units[i], units[i + d]) + 1, 2
            ):
                vnode.add_op(Dense(u, tf.nn.relu))
        struct.connect(prev_node, vnode)
        prev_node = vnode
github deephyper / deephyper / docs / tutorials / polynome2_nas / search_space.py View on Github external
anchor_points = collections.deque([source], maxlen=3)

    for _ in range(num_layers):
        vnode = VariableNode()
        add_dense_to_(vnode)

        arch.connect(prev_input, vnode)

        # * Cell output
        cell_output = vnode

        cmerge = ConstantNode()
        cmerge.set_op(AddByProjecting(arch, [cell_output], activation='relu'))

        for anchor in anchor_points:
            skipco = VariableNode()
            skipco.add_op(Tensor([]))
            skipco.add_op(Connect(arch, anchor))
            arch.connect(skipco, cmerge)

        # ! for next iter
        prev_input = cmerge
        anchor_points.append(prev_input)


    return arch
github deephyper / deephyper / deephyper / search / nas / model / space / block.py View on Github external
        return len(list(filter(lambda n: isinstance(n, VariableNode), self.nodes)))
github deephyper / deephyper / deephyper / search / nas / model / space / block.py View on Github external
            filter(lambda n: isinstance(n, VariableNode), self.inputs))
        variable_ouputs = list(