Welvet examples

54. stub/evaluation

Open original example β†—Recorded results Β· not a live execution

Part: VIII Β· Stubs
Package: github.com/openfluke/welvet/stub/evaluation
Status: partial β€” 🚧

When

Scaffold / experimental stub stub/evaluation (may be partial).

Where

import "github.com/openfluke/welvet/stub/evaluation"

cd 54-stub-evaluation && source ../env.sh && go run .

Why

Benchmark grids through runtime/forward with deviation metrics.

What

EvaluateNetwork, MultiNetworkEvaluation, DeviationMetrics.

Sample output (captured)

<nil> evaluation: length mismatch inputs=1 expected=4

Live capture from go run ./cmd/runall on local ../../welvet (exit 0).

Source

Copied from the Welvet feature book examples (openfluke.github.io/welvet/examples/54-stub-evaluation).

main.go

Download source ↓
package main

import (
	"fmt"

	"github.com/openfluke/welvet/architecture"
	"github.com/openfluke/welvet/core"
	"github.com/openfluke/welvet/stub/evaluation"
)

func main() {
	g := architecture.NewGrid(1, 1, 1, 1)
	in := []*core.Tensor[float32]{core.NewTensor[float32](1, 4)}
	rep, err := evaluation.EvaluateNetwork(g, in, []float64{0, 0, 0, 0})
	fmt.Println(rep, err)
}