Comments (5)
Tl;DR: onnx-go is working, but the API will change!
- The bug with the Gorgonia backend has been fixed (hidden in the
im2col
operator Issue 268 of Gorgonia).
I have modified the test branchdirected-graph
(which have a vendorer version of GorgoniaThe tweaked version of Gorgonia). This branch is experimental but ok. - I have started to write a simple backend (simpler but less efficient than Gorgonia without automatic differentiation). This has helped me to setup a more usable API for the interfaces.
OperationApplyer
andOperation
should be replaced by something more elegant:
// OperationCarrier is any graph that can apply operations on its nodes
// regarding the structure of the graph
type OperationCarrier interface {
NewOp(s string) (Op, error)
Apply(operation Op, n graph.Node) error
}
// Op represents an operation to be applied on a node N of the graph G.
type Op interface {
// Make the operation regarding the node's shape and its surrounding
// elements inside the graph.
// For example, the Make operation of the Add operator can take care of broadcasting.
// please take care that within this method you can use shape, type and dimensions of
// the children nodes, but (most of the time) not their actual values.
//
// WARNING: this is not the actual execution of the operation that should be performed
// with whatever method at runtime while walking the graph. The order of execution
// of the operators is not guaranteed at the build phase.
Make(g graph.WeightedDirected, n graph.Node) error
}
I need to adapt Gorgonia to use this new API.
from onnx-go.
Very cool, hope you continue with this. Being able to convert a model from most any framework into ONNX, then compile (or cross-compile to a different GOOS
and GOARCH
) a pure Go executable to perform inference with the model, would make deploying models significantly easier, even if inference was not optimized for speed.
from onnx-go.
Thank you very much for this message.
Yes, the project is still actively developed, but as I do it on my free time, it goes not as fast as expected the gorgonnx project was the most advanced part but was suffering from a bug I did not find.
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. - Kernighan
From the last two weeks I have decided to change the API; the protobuf conversion is not directly exposed; instead I am exposing an Unmarshal
function that takes a pointer to gonum’s GraphBuilder
interface (see the branch ˋgraph-builder`).
So far it’s easy to reconstruct the graph (and draw a nice representation with graphviz for example).
It’s also easy to write a backend that will numerically compute the graph.
By now, I am heavily modifying the Gorgonia library to make it compatible with this interface; Gorgonia can do a stable evaluation of the graph and automatic differentiation; it could be able to use it for transfer learning).
On top of that, Gorgonia has Cuda binding; the perf on the CPU is not bad, the perf on the GPU is better ;)
from onnx-go.
A lot of work has been done on onnx-go.
- The API is nearly stable
- onnx-go presents a top-level structure called
Model
- The
Model
wraps aBackend
which is a receiver for the computation graph. - The
Model
fulfills theencoding.BinaryUnmarshaler
- The
- a
ComputationBackend
is an interface that adds theRun()
method to aBackend
. This is mandatory for being able to run backend that does symbolic computation (such as Gorgonia)- ComputationBackend can be tested thanks to a
testbackend
package and theonnx
test files. - Gorgonnx is a special package that fulfills the
ComputationBackend
interface with Gorgonia.
- ComputationBackend can be tested thanks to a
from onnx-go.
I am closing this issue because the project is now stable enough
from onnx-go.
Related Issues (20)
- Cannot model.UnmarshalBinary - says 'No data found' HOT 1
- Can't import onnx model, converted from BigGAN-PyTorch HOT 2
- Implement operator LSTM,Clip for backend Gorgonia HOT 1
- Will this project be maintained further and are contributions still welcomed?
- Implement operator `LinearRegressor` for backend `gorgonia`
- "Asymmetric padding" error
- panic: negative dimension size does not make sense
- ../../go/src/gorgonia.org/tensor/dense_compat.go:442:23: undefined: array.Interface HOT 2
- Updated depens
- poor performance (run model)
- run() function calls newMachine() everytime HOT 1
- Question: unsqueeze: axes in not an []int64 HOT 3
- Support for empty tensors
- Tape machine does not reset properly for some models HOT 2
- Implement operator `PReLU` for backend `Gorgonia`
- Implement operator `Cast` for backend `Gorgonia`
- panic: index out of range HOT 4
- the Error during UnmarshalBinary(b)
- Is Conv1D supported?
- Implement operator `Gather` for backend `YYY`
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 onnx-go.