Chapter 18

layers/sequential

github.com/openfluke/welvet/layers/sequential


Why it exists

Some cells need an ordered Dense chain without burning grid hops.

What it is

Dense→Dense compose in one cell. Nested non-Dense children still open.

Go example

examples/18-sequential/main.go

Run:cd welvet/examples/18-sequential && source ../env.sh && go run .
package main

import (
	"fmt"

	"github.com/openfluke/welvet/core"
	"github.com/openfluke/welvet/layers/sequential"
)

func main() {
	l, err := sequential.New(sequential.Config{Dim: 16, Depth: 3})
	if err != nil {
		panic(err)
	}
	x := core.NewTensor[float32](1, 16)
	_, y, err := sequential.Forward(l, x)
	fmt.Println(len(y.Data), err)
}

Output

exit 0 · last run via go run .

16 <nil>