crossattention

package
v0.1.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 29, 2025 License: Apache-2.0 Imports: 1 Imported by: 7

Documentation

Overview

Package crossattention implements a cross attetion connected layer and combiner

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CrossAttention

type CrossAttention struct {
	// contains filtered or unexported fields
}

func (*CrossAttention) Disregard

func (f *CrossAttention) Disregard(n int) bool

Disregard tells whether putting value false at position n would not affect any feature output (as opposed to putting value true at position n). This excludes training samples early which would have no impact, because the next layer would see the same thing regardless of what we put.

func (*CrossAttention) Feature

func (f *CrossAttention) Feature(n int) (o uint32)

func (*CrossAttention) Put

func (f *CrossAttention) Put(n int, v bool)

Put inserts a boolean at position n.

type CrossAttentionLayer

type CrossAttentionLayer struct {
	// contains filtered or unexported fields
}

func MustNew

func MustNew(dim int, heads int) *CrossAttentionLayer

MustNew creates a new full layer with size and bits

func MustNew2 added in v0.1.8

func MustNew2(dim int, heads int) *CrossAttentionLayer

MustNew2 creates a new masked full layer with size and bits

func MustNew3 added in v0.1.8

func MustNew3(dim int, heads int) *CrossAttentionLayer

MustNew3 creates a new qkv full layer with size and bits

func MustNew4 added in v0.1.8

func MustNew4(dim int, heads int) *CrossAttentionLayer

MustNew4 creates a new masked qkv full layer with size and bits

func New

func New(dim int, heads int) (o *CrossAttentionLayer, err error)

New creates a new full layer with size and bits

func New2 added in v0.1.8

func New2(dim int, heads int) (o *CrossAttentionLayer, err error)

New2 creates a new masked full layer with size and bits

func New3 added in v0.1.8

func New3(dim int, heads int) (o *CrossAttentionLayer, err error)

New3 creates a new qkv full layer with size and bits

func New4 added in v0.1.8

func New4(dim int, heads int) (o *CrossAttentionLayer, err error)

New4 creates a new masked qkv full layer with size and bits

func (*CrossAttentionLayer) Lay

Lay turns full layer into a combiner

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL