Comments (8)
Hi all,
Did anyone try to use backprop with accelerate?
from backprop.
Thanks!
As of the recent version 0.2, it should be able to used with accelerate, provided the types all have a Backprop
instance. I'm currently working on an adapter now that gives all the right instances to accelerate types, but there's nothing stopping anyone from experimenting with the instances on their own!
The bigger work issue is probably porting all of the linear algebra operations with their gradients, which is a bit of a boilerplatey undertaking (see hmatrix-backprop). Accelerate types might work, but you also would need to lift linear algebra functions (like dot products, matrix multiplications, etc.) by providing their individual gradients as well for the user. This is something I'm also working on getting out soon!
from backprop.
@mstksg Awesome! Thanks for the pointers to the hmatrix integration - I'll have a look. I can't promise you much help as of now unfortunately but this might change in the near future.
from backprop.
Have you seen https://github.com/tmcdonell/accelerate-blas?
It could be a good place to start augmenting with backprop variables.
from backprop.
I am trying to figure it out now. My problem is:
if a neural network with fully connected layers is represented as
network :: (Reifies s W) =>
=> BVar s (Acc (Matrix Float)) -- ^ Inputs
-> BVar s [Acc (Matrix Float)] -- ^ Weights
-> BVar s (Acc (Matrix Float)) -- ^ Outputs
then how do I represent [Acc (Matrix Float)]
as Arrays a => Acc a
?
An additional problem is in the discrepancy between pure equations (backprop library) and impure, GPU-specific operations (Accelerate DSL), which might ultimately result in a poor speed annihilating the advantages of GPU use.
from backprop.
I am using the matrix-matrix multiplication (<>)
from accelerate-blas package as a basis of a linear layer:
linear :: (Reifies s W, Numeric e)
=> BVar s (Acc (Matrix e))
-> BVar s (Acc (Matrix e))
-> BVar s (Acc (Matrix e))
from backprop.
One approach might be to give Acc
a backprop instance, like
instance Backprop (Acc a) where
zero :: Acc a -> Acc a
one :: Acc a -> Acc a
plus :: Acc a -> Acc a -> Acc a
As long as you can assemble the the DSL purely, it should work. One issue that might come up, however, is the partsVar
mechanic using lens-based accessing.
from backprop.
I would really love to try, but I am really, really afraid of getting a result similar to this one. Are there any limitations that you are aware of?
from backprop.
Related Issues (15)
- errors when running "./Build.hs exe" HOT 4
- Does generic-lens help backprop? HOT 2
- Op between different types HOT 2
- Handling of case splits HOT 4
- What's the strategy for functions with no gradient? HOT 2
- Backpropagating through "stateful" operations. HOT 4
- Hessian computation
- Jacobians and Op HOT 4
- defining an explicit sum of squared error loss function HOT 4
- backprop now fails to compile with GHC 9.0 (due to vinyl updates?) HOT 2
- [wiki] Fix return type of sumElements HOT 1
- [wiki] add note about wiki being written for backprop >=0.2.0 HOT 2
- Why not have an undecidable instance Num a => Backprop a ? HOT 3
- backprop as functor HOT 6
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 backprop.