diff --git a/decoder/linear_test.go b/decoder/linear_test.go index 6e7cc19..9ffbf38 100644 --- a/decoder/linear_test.go +++ b/decoder/linear_test.go @@ -94,50 +94,58 @@ func TestLinearLogistic(t *testing.T) { func TestInputPool1D(t *testing.T) { dec := Linear{} - shape := tensor.NewShape([]int{1, 5, 6, 6}, nil, nil) + shape := tensor.NewShape([]int{1, 5, 6, 6}) vals := make([]float32, shape.Len()) for i := range vals { vals[i] = float32(i) } - tensor := tensor.NewFloat32Shape(shape, vals) - layer := TestLayer{tensors: map[string]tensor.Tensor{"var0": tensor}} + tsr := tensor.NewFloat32(shape.Sizes) + tsr.SetNumRows(1) + for i := range tsr.Values { + tsr.Values[i] = vals[i] + } + layer := TestLayer{tensors: map[string]tensor.Tensor{"var0": tsr}} dec.InitPool(2, &layer, 0, IdentityFunc) dec.Input("var0", 0) - expected := tensor.SubSpace([]int{0, 0}).(*tensor.Float32).Values + expected := tsr.SubSpace([]int{0, 0}).(*tensor.Float32).Values assert.Equal(t, expected, dec.Inputs) dec.InitPool(2, &layer, 1, IdentityFunc) dec.Input("var0", 0) - expected = tensor.SubSpace([]int{0, 1}).(*tensor.Float32).Values + expected = tsr.SubSpace([]int{0, 1}).(*tensor.Float32).Values assert.Equal(t, expected, dec.Inputs) } func TestInputPool2D(t *testing.T) { dec := Linear{} - shape := tensor.NewShape([]int{2, 5, 6, 6}, nil, nil) + shape := tensor.NewShape([]int{2, 5, 6, 6}) vals := make([]float32, shape.Len()) for i := range vals { vals[i] = float32(i) } - tensor := tensor.NewFloat32Shape(shape, vals) - layer := TestLayer{tensors: map[string]tensor.Tensor{"var0": tensor}} + tsr := tensor.NewFloat32(shape.Sizes) + for i := range tsr.Values { + tsr.Values[i] = vals[i] + } + + layer := TestLayer{tensors: map[string]tensor.Tensor{"var0": tsr}} dec.InitPool(2, &layer, 0, IdentityFunc) dec.Input("var0", 0) - expected := tensor.SubSpace([]int{0, 0}).(*tensor.Float32).Values + expected := tsr.SubSpace([]int{0, 0}).(*tensor.Float32).Values assert.Equal(t, expected, dec.Inputs) dec.InitPool(2, &layer, 1, IdentityFunc) dec.Input("var0", 0) - expected = tensor.SubSpace([]int{0, 1}).(*tensor.Float32).Values + expected = tsr.SubSpace([]int{0, 1}).(*tensor.Float32).Values assert.Equal(t, expected, dec.Inputs) dec.InitPool(2, &layer, 5, IdentityFunc) dec.Input("var0", 0) - expected = tensor.SubSpace([]int{1, 0}).(*tensor.Float32).Values + expected = tsr.SubSpace([]int{1, 0}).(*tensor.Float32).Values assert.Equal(t, expected, dec.Inputs) dec.InitPool(2, &layer, 9, IdentityFunc) dec.Input("var0", 0) - expected = tensor.SubSpace([]int{1, 4}).(*tensor.Float32).Values + expected = tsr.SubSpace([]int{1, 4}).(*tensor.Float32).Values assert.Equal(t, expected, dec.Inputs) } diff --git a/empi/mpi/printf.go b/empi/mpi/printf.go index ad65d47..d96cc57 100644 --- a/empi/mpi/printf.go +++ b/empi/mpi/printf.go @@ -38,7 +38,7 @@ func Println(fs ...any) { if WorldRank() > 0 { AllPrintln(fs...) } else { - fmt.Println(fs) + fmt.Println(fs...) } } diff --git a/erand/dists_test.go b/erand/dists_test.go index 5911463..12e55c6 100644 --- a/erand/dists_test.go +++ b/erand/dists_test.go @@ -8,18 +8,15 @@ import ( "math" "testing" - "cogentcore.org/core/tensor" "cogentcore.org/core/tensor/stats/stats" "cogentcore.org/core/tensor/table" ) func TestGaussianGen(t *testing.T) { nsamp := int(1e6) - sch := table.Schema{ - {"Val", reflect.Float32, nil, nil}, - } dt := &table.Table{} - dt.SetFromSchema(sch, nsamp) + dt.AddFloat32Column("Val") + dt.SetNumRows(nsamp) mean := 0.5 sig := 0.25 @@ -30,15 +27,15 @@ func TestGaussianGen(t *testing.T) { dt.SetFloat("Val", i, vl) } ix := table.NewIndexView(dt) - desc := agg.DescAll(ix) + desc := stats.DescAll(ix) - meanRow := desc.RowsByString("Agg", "Mean", table.Equals, table.UseCase)[0] - stdRow := desc.RowsByString("Agg", "Std", table.Equals, table.UseCase)[0] - // minRow := desc.RowsByString("Agg", "Min", table.Equals, table.UseCase)[0] - // maxRow := desc.RowsByString("Agg", "Max", table.Equals, table.UseCase)[0] + meanRow := desc.RowsByString("Stat", "Mean", table.Equals, table.UseCase)[0] + stdRow := desc.RowsByString("Stat", "Std", table.Equals, table.UseCase)[0] + // minRow := desc.RowsByString("Stat", "Min", table.Equals, table.UseCase)[0] + // maxRow := desc.RowsByString("Stat", "Max", table.Equals, table.UseCase)[0] - actMean := desc.CellFloat("Val", meanRow) - actStd := desc.CellFloat("Val", stdRow) + actMean := desc.Float("Val", meanRow) + actStd := desc.Float("Val", stdRow) if math.Abs(actMean-mean) > tol { t.Errorf("Gaussian: mean %g\t out of tolerance vs target: %g\n", actMean, mean) @@ -53,11 +50,9 @@ func TestGaussianGen(t *testing.T) { func TestBinomialGen(t *testing.T) { nsamp := int(1e6) - sch := table.Schema{ - {"Val", reflect.Float32, nil, nil}, - } dt := &table.Table{} - dt.SetFromSchema(sch, nsamp) + dt.AddFloat32Column("Val") + dt.SetNumRows(nsamp) n := 1.0 p := 0.5 @@ -68,17 +63,17 @@ func TestBinomialGen(t *testing.T) { dt.SetFloat("Val", i, vl) } ix := table.NewIndexView(dt) - desc := agg.DescAll(ix) + desc := stats.DescAll(ix) - meanRow := desc.RowsByString("Agg", "Mean", table.Equals, table.UseCase)[0] - stdRow := desc.RowsByString("Agg", "Std", table.Equals, table.UseCase)[0] - minRow := desc.RowsByString("Agg", "Min", table.Equals, table.UseCase)[0] - maxRow := desc.RowsByString("Agg", "Max", table.Equals, table.UseCase)[0] + meanRow := desc.RowsByString("Stat", "Mean", table.Equals, table.UseCase)[0] + stdRow := desc.RowsByString("Stat", "Std", table.Equals, table.UseCase)[0] + minRow := desc.RowsByString("Stat", "Min", table.Equals, table.UseCase)[0] + maxRow := desc.RowsByString("Stat", "Max", table.Equals, table.UseCase)[0] - actMean := desc.CellFloat("Val", meanRow) - actStd := desc.CellFloat("Val", stdRow) - actMin := desc.CellFloat("Val", minRow) - actMax := desc.CellFloat("Val", maxRow) + actMean := desc.Float("Val", meanRow) + actStd := desc.Float("Val", stdRow) + actMin := desc.Float("Val", minRow) + actMax := desc.Float("Val", maxRow) mean := n * p if math.Abs(actMean-mean) > tol { @@ -101,11 +96,9 @@ func TestBinomialGen(t *testing.T) { func TestPoissonGen(t *testing.T) { nsamp := int(1e6) - sch := table.Schema{ - {"Val", reflect.Float32, nil, nil}, - } dt := &table.Table{} - dt.SetFromSchema(sch, nsamp) + dt.AddFloat32Column("Val") + dt.SetNumRows(nsamp) lambda := 10.0 tol := 1e-2 @@ -115,17 +108,17 @@ func TestPoissonGen(t *testing.T) { dt.SetFloat("Val", i, vl) } ix := table.NewIndexView(dt) - desc := agg.DescAll(ix) + desc := stats.DescAll(ix) - meanRow := desc.RowsByString("Agg", "Mean", table.Equals, table.UseCase)[0] - stdRow := desc.RowsByString("Agg", "Std", table.Equals, table.UseCase)[0] - minRow := desc.RowsByString("Agg", "Min", table.Equals, table.UseCase)[0] - // maxRow := desc.RowsByString("Agg", "Max", table.Equals, table.UseCase)[0] + meanRow := desc.RowsByString("Stat", "Mean", table.Equals, table.UseCase)[0] + stdRow := desc.RowsByString("Stat", "Std", table.Equals, table.UseCase)[0] + minRow := desc.RowsByString("Stat", "Min", table.Equals, table.UseCase)[0] + // maxRow := desc.RowsByString("Stat", "Max", table.Equals, table.UseCase)[0] - actMean := desc.CellFloat("Val", meanRow) - actStd := desc.CellFloat("Val", stdRow) - actMin := desc.CellFloat("Val", minRow) - // actMax := desc.CellFloat("Val", maxRow) + actMean := desc.Float("Val", meanRow) + actStd := desc.Float("Val", stdRow) + actMin := desc.Float("Val", minRow) + // actMax := desc.Float("Val", maxRow) mean := lambda if math.Abs(actMean-mean) > tol { @@ -148,11 +141,9 @@ func TestPoissonGen(t *testing.T) { func TestGammaGen(t *testing.T) { nsamp := int(1e6) - sch := table.Schema{ - {"Val", reflect.Float32, nil, nil}, - } dt := &table.Table{} - dt.SetFromSchema(sch, nsamp) + dt.AddFloat32Column("Val") + dt.SetNumRows(nsamp) alpha := 0.5 beta := 0.8 @@ -163,13 +154,13 @@ func TestGammaGen(t *testing.T) { dt.SetFloat("Val", i, vl) } ix := table.NewIndexView(dt) - desc := agg.DescAll(ix) + desc := stats.DescAll(ix) - meanRow := desc.RowsByString("Agg", "Mean", table.Equals, table.UseCase)[0] - stdRow := desc.RowsByString("Agg", "Std", table.Equals, table.UseCase)[0] + meanRow := desc.RowsByString("Stat", "Mean", table.Equals, table.UseCase)[0] + stdRow := desc.RowsByString("Stat", "Std", table.Equals, table.UseCase)[0] - actMean := desc.CellFloat("Val", meanRow) - actStd := desc.CellFloat("Val", stdRow) + actMean := desc.Float("Val", meanRow) + actStd := desc.Float("Val", stdRow) mean := alpha / beta if math.Abs(actMean-mean) > tol { @@ -186,11 +177,9 @@ func TestGammaGen(t *testing.T) { func TestBetaGen(t *testing.T) { nsamp := int(1e6) - sch := table.Schema{ - {"Val", reflect.Float32, nil, nil}, - } dt := &table.Table{} - dt.SetFromSchema(sch, nsamp) + dt.AddFloat32Column("Val") + dt.SetNumRows(nsamp) alpha := 0.5 beta := 0.8 @@ -201,13 +190,13 @@ func TestBetaGen(t *testing.T) { dt.SetFloat("Val", i, vl) } ix := table.NewIndexView(dt) - desc := agg.DescAll(ix) + desc := stats.DescAll(ix) - meanRow := desc.RowsByString("Agg", "Mean", table.Equals, table.UseCase)[0] - stdRow := desc.RowsByString("Agg", "Std", table.Equals, table.UseCase)[0] + meanRow := desc.RowsByString("Stat", "Mean", table.Equals, table.UseCase)[0] + stdRow := desc.RowsByString("Stat", "Std", table.Equals, table.UseCase)[0] - actMean := desc.CellFloat("Val", meanRow) - actStd := desc.CellFloat("Val", stdRow) + actMean := desc.Float("Val", meanRow) + actStd := desc.Float("Val", stdRow) mean := alpha / (alpha + beta) if math.Abs(actMean-mean) > tol { diff --git a/patgen/configvocabpats_test.go b/patgen/configvocabpats_test.go index 049db50..c090dca 100644 --- a/patgen/configvocabpats_test.go +++ b/patgen/configvocabpats_test.go @@ -2,14 +2,16 @@ package patgen import ( "fmt" - "reflect" + "slices" "testing" "cogentcore.org/core/tensor/table" + "github.com/stretchr/testify/assert" + "golang.org/x/exp/maps" ) func TestVocab(t *testing.T) { - fmt.Println("Testing starts") + NewRand(10) m := make(Vocab) AddVocabEmpty(m, "empty", 6, 3, 3) AddVocabPermutedBinary(m, "A", 6, 3, 3, 0.3, 0.5) @@ -20,35 +22,231 @@ func TestVocab(t *testing.T) { VocabShuffle(m, []string{"B'"}) AddVocabClone(m, "B''", "B'") - fmt.Println("map") - fmt.Println(reflect.ValueOf(m).MapKeys()) + keys := maps.Keys(m) + slices.Sort(keys) + exmap := `[A A' AB-C B B' B'' ctxt1 empty]` + // fmt.Println("map") + // fmt.Println(reflect.ValueOf(m).MapKeys()) + assert.Equal(t, exmap, fmt.Sprintf("%v", keys)) - fmt.Println("empty") - fmt.Println(m["empty"].String()) + exempty := `Tensor: [row: 6, Y: 3, X: 3] +[0 0]: 0 0 0 +[0 1]: 0 0 0 +[0 2]: 0 0 0 +[1 0]: 0 0 0 +[1 1]: 0 0 0 +[1 2]: 0 0 0 +[2 0]: 0 0 0 +[2 1]: 0 0 0 +[2 2]: 0 0 0 +[3 0]: 0 0 0 +[3 1]: 0 0 0 +[3 2]: 0 0 0 +[4 0]: 0 0 0 +[4 1]: 0 0 0 +[4 2]: 0 0 0 +[5 0]: 0 0 0 +[5 1]: 0 0 0 +[5 2]: 0 0 0 +` + // fmt.Println("empty") + // fmt.Println(m["empty"].String()) + assert.Equal(t, exempty, m["empty"].String()) - fmt.Println("A") - fmt.Println(m["A"].String()) + exa := `Tensor: [row: 6, Y: 3, X: 3] +[0 0]: 0 1 1 +[0 1]: 0 0 0 +[0 2]: 1 0 0 +[1 0]: 0 0 0 +[1 1]: 1 0 1 +[1 2]: 0 1 0 +[2 0]: 1 0 1 +[2 1]: 0 0 0 +[2 2]: 0 1 0 +[3 0]: 0 1 0 +[3 1]: 0 1 0 +[3 2]: 0 0 1 +[4 0]: 0 0 0 +[4 1]: 0 1 0 +[4 2]: 1 1 0 +[5 0]: 0 0 0 +[5 1]: 1 0 0 +[5 2]: 1 0 1 +` - fmt.Println("B") - fmt.Println(m["B"].String()) + // fmt.Println("A") + // fmt.Println(m["A"].String()) + assert.Equal(t, exa, m["A"].String()) - fmt.Println("ctxt1") - fmt.Println(m["ctxt1"].String()) + exb := `Tensor: [row: 6, Y: 3, X: 3] +[0 0]: 0 1 1 +[0 1]: 0 0 0 +[0 2]: 1 0 0 +[1 0]: 0 0 1 +[1 1]: 0 1 0 +[1 2]: 1 0 0 +[2 0]: 0 0 1 +[2 1]: 0 1 0 +[2 2]: 1 0 0 +[3 0]: 0 1 0 +[3 1]: 0 1 0 +[3 2]: 1 0 0 +[4 0]: 0 1 0 +[4 1]: 0 1 0 +[4 2]: 1 0 0 +[5 0]: 0 1 1 +[5 1]: 0 0 0 +[5 2]: 1 0 0 +` - fmt.Println("AB-C") - fmt.Println(m["AB-C"].String()) + // fmt.Println("B") + // fmt.Println(m["B"].String()) + assert.Equal(t, exb, m["B"].String()) - fmt.Println("A'") - fmt.Println(m["A'"].String()) + exctxt := `Tensor: [row: 6, Y: 3, X: 3] +[0 0]: 0 1 1 +[0 1]: 0 0 0 +[0 2]: 1 0 0 +[1 0]: 0 1 1 +[1 1]: 0 0 0 +[1 2]: 1 0 0 +[2 0]: 0 1 1 +[2 1]: 0 0 0 +[2 2]: 1 0 0 +[3 0]: 0 1 1 +[3 1]: 0 0 0 +[3 2]: 1 0 0 +[4 0]: 0 1 1 +[4 1]: 0 0 0 +[4 2]: 1 0 0 +[5 0]: 0 1 1 +[5 1]: 0 0 0 +[5 2]: 1 0 0 +` - fmt.Println("B'") - fmt.Println(m["B'"].String()) + // fmt.Println("ctxt1") + // fmt.Println(m["ctxt1"].String()) + assert.Equal(t, exctxt, m["ctxt1"].String()) - fmt.Println("B''") - fmt.Println(m["B''"].String()) + exabc := `Tensor: [row: 12, Y: 3, X: 3] +[0 0]: 0 1 1 +[0 1]: 0 0 0 +[0 2]: 1 0 0 +[1 0]: 0 0 0 +[1 1]: 1 0 1 +[1 2]: 0 1 0 +[2 0]: 1 0 1 +[2 1]: 0 0 0 +[2 2]: 0 1 0 +[3 0]: 0 1 0 +[3 1]: 0 1 0 +[3 2]: 0 0 1 +[4 0]: 0 0 0 +[4 1]: 0 1 0 +[4 2]: 1 1 0 +[5 0]: 0 0 0 +[5 1]: 1 0 0 +[5 2]: 1 0 1 +[6 0]: 0 1 1 +[6 1]: 0 0 0 +[6 2]: 1 0 0 +[7 0]: 0 0 1 +[7 1]: 0 1 0 +[7 2]: 1 0 0 +[8 0]: 0 0 1 +[8 1]: 0 1 0 +[8 2]: 1 0 0 +[9 0]: 0 1 0 +[9 1]: 0 1 0 +[9 2]: 1 0 0 +[10 0]: 0 1 0 +[10 1]: 0 1 0 +[10 2]: 1 0 0 +[11 0]: 0 1 1 +[11 1]: 0 0 0 +[11 2]: 1 0 0 +` + // fmt.Println("AB-C") + // fmt.Println(m["AB-C"].String()) + assert.Equal(t, exabc, m["AB-C"].String()) + + exap := `Tensor: [row: 6, Y: 3, X: 3] +[0 0]: 0 1 1 +[0 1]: 0 0 0 +[0 2]: 1 0 0 +[1 0]: 0 0 0 +[1 1]: 1 0 1 +[1 2]: 0 1 0 +[2 0]: 1 0 1 +[2 1]: 0 0 0 +[2 2]: 0 1 0 +[3 0]: 0 1 0 +[3 1]: 0 1 0 +[3 2]: 0 0 1 +[4 0]: 0 0 0 +[4 1]: 0 1 0 +[4 2]: 1 1 0 +[5 0]: 0 0 0 +[5 1]: 1 0 0 +[5 2]: 1 0 1 +` + + // fmt.Println("A'") + // fmt.Println(m["A'"].String()) + assert.Equal(t, exap, m["A'"].String()) + + exbp := `Tensor: [row: 6, Y: 3, X: 3] +[0 0]: 0 1 1 +[0 1]: 0 0 0 +[0 2]: 1 0 0 +[1 0]: 0 1 0 +[1 1]: 0 1 0 +[1 2]: 1 0 0 +[2 0]: 0 0 1 +[2 1]: 0 1 0 +[2 2]: 1 0 0 +[3 0]: 0 0 1 +[3 1]: 0 1 0 +[3 2]: 1 0 0 +[4 0]: 0 1 1 +[4 1]: 0 0 0 +[4 2]: 1 0 0 +[5 0]: 0 1 0 +[5 1]: 0 1 0 +[5 2]: 1 0 0 +` + + // fmt.Println("B'") + // fmt.Println(m["B'"].String()) + assert.Equal(t, exbp, m["B'"].String()) + + exbpp := `Tensor: [row: 6, Y: 3, X: 3] +[0 0]: 0 1 1 +[0 1]: 0 0 0 +[0 2]: 1 0 0 +[1 0]: 0 1 0 +[1 1]: 0 1 0 +[1 2]: 1 0 0 +[2 0]: 0 0 1 +[2 1]: 0 1 0 +[2 2]: 1 0 0 +[3 0]: 0 0 1 +[3 1]: 0 1 0 +[3 2]: 1 0 0 +[4 0]: 0 1 1 +[4 1]: 0 0 0 +[4 2]: 1 0 0 +[5 0]: 0 1 0 +[5 1]: 0 1 0 +[5 2]: 1 0 0 +` + + // fmt.Println("B''") + // fmt.Println(m["B''"].String()) + assert.Equal(t, exbpp, m["B''"].String()) // config pats - dt := table.NewTable("TrainAB") + dt := table.NewTable(0, "TrainAB") InitPats(dt, "TrainAB", "describe", "Input", "ECout", 6, 3, 2, 3, 3) MixPats(dt, m, "Input", []string{"A", "B", "ctxt1", "ctxt1", "empty", "B'"}) MixPats(dt, m, "ECout", []string{"A", "B", "ctxt1", "ctxt1", "empty", "B'"}) @@ -56,11 +254,129 @@ func TestVocab(t *testing.T) { // try shuffle Shuffle(dt, []int{0, 1, 2, 3, 4, 5}, []string{"Input", "ECout"}, false) - fmt.Println("Input Pats") - fmt.Println(dt.ColumnByName("Input").Shape().Sizes) - fmt.Println(dt.ColumnByName("Input").T()) + exip := `Tensor: [Row: 6, ySize: 3, xSize: 2, poolY: 3, poolX: 3] +[0 0 0]: 0 0 0 0 1 0 +[0 0 1]: 0 1 0 0 1 0 +[0 0 2]: 1 1 0 1 0 0 +[0 1 0]: 0 1 1 0 1 1 +[0 1 1]: 0 0 0 0 0 0 +[0 1 2]: 1 0 0 1 0 0 +[0 2 0]: 0 0 0 0 1 1 +[0 2 1]: 0 0 0 0 0 0 +[0 2 2]: 0 0 0 1 0 0 +[1 0 0]: 0 1 0 0 1 0 +[1 0 1]: 0 1 0 0 1 0 +[1 0 2]: 0 0 1 1 0 0 +[1 1 0]: 0 1 1 0 1 1 +[1 1 1]: 0 0 0 0 0 0 +[1 1 2]: 1 0 0 1 0 0 +[1 2 0]: 0 0 0 0 0 1 +[1 2 1]: 0 0 0 0 1 0 +[1 2 2]: 0 0 0 1 0 0 +[2 0 0]: 1 0 1 0 0 1 +[2 0 1]: 0 0 0 0 1 0 +[2 0 2]: 0 1 0 1 0 0 +[2 1 0]: 0 1 1 0 1 1 +[2 1 1]: 0 0 0 0 0 0 +[2 1 2]: 1 0 0 1 0 0 +[2 2 0]: 0 0 0 0 0 1 +[2 2 1]: 0 0 0 0 1 0 +[2 2 2]: 0 0 0 1 0 0 +[3 0 0]: 0 0 0 0 0 1 +[3 0 1]: 1 0 1 0 1 0 +[3 0 2]: 0 1 0 1 0 0 +[3 1 0]: 0 1 1 0 1 1 +[3 1 1]: 0 0 0 0 0 0 +[3 1 2]: 1 0 0 1 0 0 +[3 2 0]: 0 0 0 0 1 0 +[3 2 1]: 0 0 0 0 1 0 +[3 2 2]: 0 0 0 1 0 0 +[4 0 0]: 0 0 0 0 1 1 +[4 0 1]: 1 0 0 0 0 0 +[4 0 2]: 1 0 1 1 0 0 +[4 1 0]: 0 1 1 0 1 1 +[4 1 1]: 0 0 0 0 0 0 +[4 1 2]: 1 0 0 1 0 0 +[4 2 0]: 0 0 0 0 1 0 +[4 2 1]: 0 0 0 0 1 0 +[4 2 2]: 0 0 0 1 0 0 +[5 0 0]: 0 1 1 0 1 1 +[5 0 1]: 0 0 0 0 0 0 +[5 0 2]: 1 0 0 1 0 0 +[5 1 0]: 0 1 1 0 1 1 +[5 1 1]: 0 0 0 0 0 0 +[5 1 2]: 1 0 0 1 0 0 +[5 2 0]: 0 0 0 0 1 1 +[5 2 1]: 0 0 0 0 0 0 +[5 2 2]: 0 0 0 1 0 0 +` + // fmt.Println("Input Pats") + // fmt.Println(dt.ColumnByName("Input").Shape().Sizes) + // fmt.Println(dt.ColumnByName("Input").String()) + assert.Equal(t, []int{6, 3, 2, 3, 3}, dt.ColumnByName("Input").Shape().Sizes) + assert.Equal(t, exip, dt.ColumnByName("Input").String()) + + exop := `Tensor: [Row: 6, ySize: 3, xSize: 2, poolY: 3, poolX: 3] +[0 0 0]: 0 0 0 0 1 0 +[0 0 1]: 0 1 0 0 1 0 +[0 0 2]: 1 1 0 1 0 0 +[0 1 0]: 0 1 1 0 1 1 +[0 1 1]: 0 0 0 0 0 0 +[0 1 2]: 1 0 0 1 0 0 +[0 2 0]: 0 0 0 0 1 1 +[0 2 1]: 0 0 0 0 0 0 +[0 2 2]: 0 0 0 1 0 0 +[1 0 0]: 0 1 0 0 1 0 +[1 0 1]: 0 1 0 0 1 0 +[1 0 2]: 0 0 1 1 0 0 +[1 1 0]: 0 1 1 0 1 1 +[1 1 1]: 0 0 0 0 0 0 +[1 1 2]: 1 0 0 1 0 0 +[1 2 0]: 0 0 0 0 0 1 +[1 2 1]: 0 0 0 0 1 0 +[1 2 2]: 0 0 0 1 0 0 +[2 0 0]: 1 0 1 0 0 1 +[2 0 1]: 0 0 0 0 1 0 +[2 0 2]: 0 1 0 1 0 0 +[2 1 0]: 0 1 1 0 1 1 +[2 1 1]: 0 0 0 0 0 0 +[2 1 2]: 1 0 0 1 0 0 +[2 2 0]: 0 0 0 0 0 1 +[2 2 1]: 0 0 0 0 1 0 +[2 2 2]: 0 0 0 1 0 0 +[3 0 0]: 0 0 0 0 0 1 +[3 0 1]: 1 0 1 0 1 0 +[3 0 2]: 0 1 0 1 0 0 +[3 1 0]: 0 1 1 0 1 1 +[3 1 1]: 0 0 0 0 0 0 +[3 1 2]: 1 0 0 1 0 0 +[3 2 0]: 0 0 0 0 1 0 +[3 2 1]: 0 0 0 0 1 0 +[3 2 2]: 0 0 0 1 0 0 +[4 0 0]: 0 0 0 0 1 1 +[4 0 1]: 1 0 0 0 0 0 +[4 0 2]: 1 0 1 1 0 0 +[4 1 0]: 0 1 1 0 1 1 +[4 1 1]: 0 0 0 0 0 0 +[4 1 2]: 1 0 0 1 0 0 +[4 2 0]: 0 0 0 0 1 0 +[4 2 1]: 0 0 0 0 1 0 +[4 2 2]: 0 0 0 1 0 0 +[5 0 0]: 0 1 1 0 1 1 +[5 0 1]: 0 0 0 0 0 0 +[5 0 2]: 1 0 0 1 0 0 +[5 1 0]: 0 1 1 0 1 1 +[5 1 1]: 0 0 0 0 0 0 +[5 1 2]: 1 0 0 1 0 0 +[5 2 0]: 0 0 0 0 1 1 +[5 2 1]: 0 0 0 0 0 0 +[5 2 2]: 0 0 0 1 0 0 +` + + // fmt.Println("ECout Pats") + // fmt.Println(dt.ColumnByName("ECout").Shape().Sizes) + // fmt.Println(dt.ColumnByName("ECout").String()) - fmt.Println("ECout Pats") - fmt.Println(dt.ColumnByName("ECout").Shape().Sizes) - fmt.Println(dt.ColumnByName("ECout").T()) + assert.Equal(t, []int{6, 3, 2, 3, 3}, dt.ColumnByName("ECout").Shape().Sizes) + assert.Equal(t, exop, dt.ColumnByName("ECout").String()) }