-
Notifications
You must be signed in to change notification settings - Fork 796
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
15 additions
and
85 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
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,26 +1,14 @@ | ||
package dataset | ||
|
||
import ( | ||
"github.com/samber/lo" | ||
"github.com/stretchr/testify/assert" | ||
"github.com/zhenghaoz/gorse/common/nn" | ||
"testing" | ||
) | ||
|
||
func TestIris(t *testing.T) { | ||
func TestLoadIris(t *testing.T) { | ||
data, target, err := LoadIris() | ||
assert.NoError(t, err) | ||
_ = data | ||
_ = target | ||
|
||
x := nn.NewTensor(lo.Flatten(data), len(data), 4) | ||
|
||
model := nn.NewSequential( | ||
nn.NewLinear(4, 100), | ||
nn.NewReLU(), | ||
nn.NewLinear(100, 100), | ||
nn.NewLinear(100, 3), | ||
nn.NewFlatten(), | ||
) | ||
_ = model | ||
assert.Len(t, data, 150) | ||
assert.Len(t, data[0], 4) | ||
assert.Len(t, target, 150) | ||
} |
This file was deleted.
Oops, something went wrong.
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,8 @@ | ||
package util | ||
|
||
import "strconv" | ||
|
||
func ParseFloat32(s string) (float32, error) { | ||
v, err := strconv.ParseFloat(s, 32) | ||
return float32(v), err | ||
} |
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