Comments (3)
Work in progress, see https://github.com/owulveryck/onnx-go/tree/new-interface
from onnx-go.
We should also have a look at the Operation
type which is using a pointer to pb.AttributeProto
; but this is declared inside an internal package...
from onnx-go.
Here is my current proposal.
I create a new interface:
// AttributesUnmarshaler is the interface implemented by types that can unmarshal to
// themselves. AttributesUnmarshaler must copy the data if it wished to retain the data after returning.
type AttributesUnmarshaler interface {
UnmarshalONNXAttributes(map[string]interface{}) error
}
The map[string]interface{}
is a key value of the attributes; ex:
map[string]interface{}{
"pad": []int{1,1},
"kernel": tensor.Dense{},
}
It's simple for the type to check whether and expected value is present in the map, and the type inference shouldn't be compliated.
On top of that, I may keep this method private:
func unmarshalAttributes(attrs []*pb.AttributeProto, v interface{}) error {
return pb.UnmarshalAttributes(attrs, v)
}
When decoding the attributes, I will first check if the Operator is fulfilling AttributesUnmarshaler
, otherwise a call to unmarshalAttributes
is performed. unmarshalAttributes
will use the tags
of the operator and this should be carefully documented.
from onnx-go.
Related Issues (20)
- 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`
- Any plan to support Graph attribute type?
- Time taken to initialize model
- shame on the developers HOT 5
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.