-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added the Abs operator * Issue [#96](#96): Update import paths. * Setup CI/CD checks * Breaking pipeline? * Add linter and test jobs * Fix syntax * Split build jobs * Fix imports for Abs operator * add PRelu operator * fix typos in prelu comments * Fix new ONNX tests * Better ordering * Issue #151 : Update import path in readme * Keep using Go1.19 * Fix a lot of linter issues * Fix more lint * Got to cast operator and disable `captLocal` * WIP: more lint fixes * WIP: More lint fixes * More wip on lint errors * WIP on lint * More WIP * Fix all lints except errors * Fix all lints * Fixed part of tests * Fix validate input tests. * Worked on fixing tests * Fixed rest of tests * Resolve all MR comments * Added cos operator (#159) * Added cos operator * Replace s struct identifier * Missed characters * Fixed comment * Resolved MR comments * Fix tests * Fix lint * remove unused errors * Fix naming * Group declarations --------- Co-authored-by: Swopper050 <[email protected]> * Added acosh operator (#163) * Added acosh operator * Merged develop --------- Co-authored-by: Swopper050 <[email protected]> * Add Conv operator (#177) * Working on conv operator * Added all attributes for conv operator * WIP on conv operator * Shit's hard * WIP on conv operator * Set defaults for attributes * Finished computation of dilated kernel * Start of 1D conv implementation * Almost finished 1D convolution * Working 2D conv! * Working convolution operator * Add mnist model * Added tests + bugfixes in conv * Full coverage * Remove unnecessary if * Kept division by 2 * Fix last MR comment * Fix lint? --------- Co-authored-by: Swopper050 <[email protected]> * Added acos operator (#162) * Added acos operator * Merge develop * Group declarations --------- Co-authored-by: Swopper050 <[email protected]> * Added Sin operator (#157) * Added Sin operator * Added ONNX sin test coverage * Fix tests * Remove unused error * Remove unused error * Fix lint * Fix lint * Use float type --------- Co-authored-by: Swopper050 <[email protected]> * Added asin operator (#161) * Added asin operator * Use FloatType --------- Co-authored-by: Swopper050 <[email protected]> * Added Sinh operator (#158) * Added sinh operator * Updated comments * Use FloatType --------- Co-authored-by: Swopper050 <[email protected]> * Added atan operator (#165) * Added atan operator * Use FloatType --------- Co-authored-by: Swopper050 <[email protected]> * Added atanh operator (#166) * Added atanh operator * Use FloatType --------- Co-authored-by: Swopper050 <[email protected]> * Added tan operator (#167) * Added tan operator * Use FloatType --------- Co-authored-by: Swopper050 <[email protected]> * Added asinh operator (#168) * Added asinh operator * Remove unused types --------- Co-authored-by: Swopper050 <[email protected]> * Added cosh operator (#160) * Added cosh operator * Group declarations * Correct Apply comment --------- Co-authored-by: Swopper050 <[email protected]> * Added softmax operator (#171) * Added softmax operator * Merged develop * Resolved MR comments --------- Co-authored-by: Swopper050 <[email protected]> * Added not operator (#170) * Added not operator * Resolved MR comments --------- Co-authored-by: Swopper050 <[email protected]> * Added boolean operators (#180) * Added boolean operators * Fix lint * Fix final linst * Create a generic apply boolean operator * Refactored boolean operators to use binary op generic function * Refactored even more * Generalized binary operations --------- Co-authored-by: Swopper050 <[email protected]> * Added comparison operators (#173) * Added equal, greater, greaterOrEqual operator * Merged develop * Resolved MR comments --------- Co-authored-by: Swopper050 <[email protected]> * Add RNN operator (#181) * WIP on RNN * WIP on RNN * Working RNN version * Added tests for RNN * Resolved MR comments * Do not export rnn specific constants --------- Co-authored-by: Swopper050 <[email protected]> * Add LSTM operator (#183) * WIP on RNN * WIP on RNN * Working RNN version * Added tests for RNN * Working version of LSTM operator * Reusable attrs and tests for LSTM * Refactored recurrent operators to share code * Resolved MR comments * Do not export rnn specific constants --------- Co-authored-by: Swopper050 <[email protected]> * Add LinearRegressor operator (#184) * WIP on LinearRegressor * Added tests for linear regressor * Added test descriptions and docstring * Do not export constants --------- Co-authored-by: Swopper050 <[email protected]> --------- Co-authored-by: Swopper050 <[email protected]> Co-authored-by: wisse <[email protected]> Co-authored-by: wipsel <[email protected]> Co-authored-by: Yannick Dylla <[email protected]>
- Loading branch information
1 parent
a4a13c1
commit 3fbddf4
Showing
133 changed files
with
9,363 additions
and
927 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
# This workflow will build a golang project | ||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go | ||
|
||
name: Go | ||
|
||
on: | ||
push: | ||
branches: [ "develop" ] | ||
pull_request: | ||
branches: [ "develop" ] | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.19 | ||
|
||
- name: Install linter | ||
run: make install_lint | ||
|
||
- name: Lint | ||
run: make lint | ||
|
||
tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.19 | ||
|
||
- name: Install dependencies | ||
run: make install | ||
|
||
- name: Install Gotestsum | ||
run: make install_gotestsum | ||
|
||
- name: Setup ONNX test data | ||
run: make test_data | ||
|
||
- name: Tests | ||
run: make test | ||
|
||
build_amd64: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.19 | ||
|
||
- name: Build amd64 | ||
run: make build_amd64 | ||
|
||
build_arm64: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.19 | ||
|
||
- name: Build arm64 | ||
run: make build_arm64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
test_data/ | ||
.coverage.out | ||
|
||
sample_models/.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,32 @@ | ||
package gonnx | ||
|
||
// InvalidShapeError is used when the shape of an input tensor does not match the expectation. | ||
const InvalidShapeError = "input shape does not match for %v: expected %v but got %v" | ||
import ( | ||
"errors" | ||
"fmt" | ||
|
||
// SetOutputTensorsError is used when the output of an operation could not be set. | ||
const SetOutputTensorsError = "could not set output tensors, expected %v tensors but got %v" | ||
"github.com/advancedclimatesystems/gonnx/onnx" | ||
) | ||
|
||
var errModel = errors.New("gonnx model error") | ||
|
||
type InvalidShapeError struct { | ||
expected onnx.Shape | ||
actual []int | ||
} | ||
|
||
func (i InvalidShapeError) Error() string { | ||
return fmt.Sprintf("invalid shape error expected: %v actual %v", i.expected, i.actual) | ||
} | ||
|
||
func ErrInvalidShape(expected onnx.Shape, actual []int) error { | ||
return InvalidShapeError{ | ||
expected: expected, | ||
actual: actual, | ||
} | ||
} | ||
|
||
// ErrModel is used for when an error ocured during setup of running onnx models. | ||
// The user can specify a formatted message using the standard formatting rules. | ||
func ErrModel(format string, a ...any) error { | ||
return fmt.Errorf("%w: %s", errModel, fmt.Sprintf(format, a...)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.