Giter VIP home page Giter VIP logo

Comments (3)

drasmuss avatar drasmuss commented on July 20, 2024

What is the error you're seeing?

from nengo-dl.

assadRasheed avatar assadRasheed commented on July 20, 2024
def build_network(neuron_type):
    with nengo.Network() as net:
        # we'll make all the nengo objects in the network
        # non-trainable. we could train them if we wanted, but they don't
        # add any representational power so we can save some computation
        # by ignoring them. note that this doesn't affect the internal
        # components of tensornodes, which will always be trainable or
        # non-trainable depending on the code written in the tensornode.
        nengo_dl.configure_settings(trainable=True)

        # the input node that will be used to feed in input images
        inp = nengo.Node(nengo.processes.PresentInput(X_train, 0.1))

        # add the first convolutional layer
        x = nengo_dl.tensor_layer(
            inp, tf.layers.conv2d, shape_in=(227, 227,3), filters=32,
            kernel_size=3)

        # apply the neural nonlinearity
        x = nengo_dl.tensor_layer(x, neuron_type, **ens_params)

        # add another convolutional layer
        x = nengo_dl.tensor_layer(
            x, tf.layers.conv2d, shape_in=(225, 225, 32),
            filters=32, kernel_size=3)
        x = nengo_dl.tensor_layer(x, neuron_type, **ens_params)

        # add a pooling layer
        x = nengo_dl.tensor_layer(
            x, tf.layers.average_pooling2d, shape_in=(223, 223, 32),
            pool_size=2, strides=2)

        # add a dense layer, with neural nonlinearity.
        # note that for all-to-all connections like this we can use the
        # normal nengo connection transform to implement the weights
        # (instead of using a separate tensor_layer). we'll use a
        # Glorot uniform distribution to initialize the weights.
        x, conn = nengo_dl.tensor_layer(
            x, neuron_type, **ens_params, transform=nengo_dl.dists.Glorot(),
            shape_in=(255,), return_conn=True)
        # we need to set the weights and biases to be trainable
        # (since we set the default to be trainable=False)
        # note: we used return_conn=True above so that we could access
        # the connection object for this reason.
        net.config[x].trainable = True
        net.config[conn].trainable = True

        # add a dropout layer
        x = nengo_dl.tensor_layer(x, tf.layers.dropout, rate=0.4)

        # the final 10 dimensional class output
        x = nengo_dl.tensor_layer(x, tf.layers.dense, units=1)

    return net, inp, x

# construct the network
net, inp, out = build_network(softlif_neurons)
with net:
    out_p = nengo.Probe(out)

# construct the simulator
minibatch_size = None
sim = nengo_dl.Simulator(net, minibatch_size=minibatch_size)

this is the code which i have edited according to my dataset.my laptop become slow download and even os ask me to close the program because of short of memory. i even become unable to copy the error trace .

from nengo-dl.

drasmuss avatar drasmuss commented on July 20, 2024

Going to close this and continue the discussion in the forum thread you started (https://forum.nengo.ai/t/memory-errors-inspite-of-very-small-dataset-in-nengo-dl/477), since this seems like a problem specific to your model/computer.

from nengo-dl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.