Comments (5)
@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.
@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.
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.
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.
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)
- Error when executing "example-rnn-regression" juice example on aarch64 target HOT 16
- Mismatched type error when compiling juice for aarch64 HOT 1
- error[E0599] no associated item named 'CUDNN_RNN_PADDED_IO_DISABLED' HOT 2
- example/rnn: Batch size must not cause errors in test HOT 1
- Failed to build HOT 4
- Fails to build on rcudnn. HOT 4
- Implement BatchNormalization2d Layer HOT 2
- Native support for Convolution Layer HOT 2
- Potential bug in NegativeLogLikelihood impl HOT 9
- cblas linker error HOT 12
- Juice for Deep Reinforcement Learning HOT 17
- add non-cuda examples HOT 3
- Fails to build with default features off HOT 1
- cuda-memcheck: "Address ... is out of bounds" HOT 1
- Unclear how to correctly compute dot product HOT 1
- The Juice book is out of date
- Unhelpful panic message on (presumably?) invalid inputs to `forward` HOT 1
- In new arch, make Layer operations return Result instead of panicking internally
- How can you continue training a model from a file? HOT 15
- Merge Layer
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from juice.