Git Product home page Git Product logo

Comments (5)

drahnr avatar drahnr commented on August 15, 2024 1

@Anton-4 I brainstormed a builder like pattern with one of my former colleagues ( I am looking at you @Nicoretti ), I can post it later tonight :) I'd be glad to see some more faces around the codebase 👍

let me know if I can help you getting kickstarted.

from juice.

Anton-4 avatar Anton-4 commented on August 15, 2024

@drahnr Could you add some more detail on what you would like the API to look like or which approach to take? I'm considering helping out.

from juice.

drahnr avatar drahnr commented on August 15, 2024

Ideally the both APIs could co-exist for a while before retireing the existing one.

This is only for input:

//     cfg.add_framework(OPENCL).gpuset([0..2])
//     cfg.add_framework()
//     cfg.add_layer(fc1).framework(CUDA).config(LinearConfig().output_size(4096))
//     cfg.add_layer(fc1).framework(AUTOSELECT).config(PoolingConfig().stride(2).output_size(4096))


// impl Config {
//     fn add_layer(self, name : String) -> LayerConfig<> {
//         self.lc = LayerConfig<>::new(name);
//         &self.lc
//     }
// }

// impl Layer {
//     fn new() -> LayerConfig {
//     }
//     fn config(self, lc : LayerConfig) -> Self {
//         self.layerconfig = lc;
//         self
//     }

from juice.

andreytkachenko avatar andreytkachenko commented on August 15, 2024

Here is my opinion on that issue:

I do want to have sort of device manager, like:

use co::prelude::*;

let mut discoverer = DeviceDiscoverer::new();
/// my laptop has 2 gpus 1 nvidia (CUDA and OpenCL) and integrated intel (OpenCL only) 
discoverer.add_discoverer(co::cuda::CudaDiscoverer::new()); // firstly added - higher priority 
discoverer.add_discoverer(co::opencl::OpenCLDiscoverer::only_gpu());
discoverer.add_discoverer(co::native::NativeDiscoverer::new());
let device_set = discoverer.discover(); // here we have 3 devices - [Nvidia<CUDA>, Intel<OpenCL>, CPU<Native>]
println!("Found: {}", device_set);

let backend = SharedBackend::new(device_set);

let model = build_model(backend);
let mut trainer = Trainer::new();
trainer.set_solver(Adam::new(0.01, ...));
trainer.set_model(model);
let epochs = trainer.fit_iter(1000); // run 1000 epochs
for epoc in epochs {
    println!("{}", epoch);
} 
fn build_model(b: Rc<Backend>) -> impl ILayer {
    model! {
         <Sequential input_shape=(28, 28, 1)>
              <Reshape shape=(768) />
              <Linear units={128} />
              <Activation type={Sigmoid} />
              
              <Linear units={256} />
              <Activation type={Sigmoid} />

              <Linear units={10} />
              <Activation type={Sigmoid} />
              <Softmax classes={10} />
         </Sequential>
    }
}

from juice.

drahnr avatar drahnr commented on August 15, 2024

That makes a lot of sense, but this adds a optimization pass (at least a bucket filling pass, but that might be way too simplistic).

I would also prefer something less xml-ish

from juice.

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.