Code Monkey home page Code Monkey logo

Comments (4)

richardliaw avatar richardliaw commented on May 18, 2024

Hey there - this seems like a problem with Ray's documentation being unclear.

What if you just did:

class SimpleClassifierTrainable(tune.Trainable):
    def _setup(self, config):
        use_cuda = torch.cuda.is_available()
        self.device = torch.device("cuda" if use_cuda else "cpu")
        self.batch_size = config["batch_size"]
        self.learning_rate = config.get("lr", 0.01)
        self.train_loader, self.val_loader = get_dataloaders(self.batch_size)
        ##############################
		# CREATE MODEL HERE
        model = sample_model(in_features=784, num_classes=10))
        self.model = model.to(self.device)
        ###############################
        self.criterion = nn.CrossEntropyLoss()
        self.optimizer = optim.Adam(self.model.parameters(),
                                    lr=self.learning_rate)

from deep_architect.

negrinho avatar negrinho commented on May 18, 2024

Hi Iacopo. Apologies for the delay. Unfortunately, I haven't been able to dedicate much time to the DeepArchitect lately, but I'm looking to resume soon. I'm curious about whether how far did you go with DeepArchitect in your work. I'm not familiar with Ray but happy to integrate some functionality as it seems widely adopted now. I don't see any inherent problems in using DeepArchitect with Ray, provided that Ray does not need too much information about the workload that it is running (e.g., the exact architecture).

from deep_architect.

iacolippo avatar iacolippo commented on May 18, 2024

Hi @negrinho

No need to apologize :-) didn't have much time to work on this either.

The idea would be to be able to use DeepArchitect functions as a sampler for a Pytorch (or TF) model in the tune.run parameter config (see here: https://gist.github.com/iacolippo/3f815fa90c254f7a065bdc446406233a#file-ray_deep_architect_ex2-py-L201). This would make it really easy to scale an architecture search from a single machine to a cluster.

I will have a person working on a closely related project starting in October, so I will hopefully be able to give more detailed information soon.

from deep_architect.

negrinho avatar negrinho commented on May 18, 2024

from deep_architect.

Related Issues (7)

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.