xor

package
v3.0.0-alpha.9 Latest Latest
Warning

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

Go to latest
Published: May 17, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package xor implements a extremely simple network that can perform the xor operation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Benchmark

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

Benchmark defines the XOR network training benchmark.

func NewBenchmark

func NewBenchmark(driver *driver.Driver) *Benchmark

NewBenchmark creates a new benchmark.

func (*Benchmark) Run

func (b *Benchmark) Run()

Run executes the benchmark.

func (*Benchmark) SelectGPU

func (b *Benchmark) SelectGPU(gpuIDs []int)

SelectGPU selects the GPU to use.

func (*Benchmark) SetUnifiedMemory

func (b *Benchmark) SetUnifiedMemory()

SetUnifiedMemory asks the benchmark to use unified memory.

func (*Benchmark) Verify

func (b *Benchmark) Verify()

Verify runs the benchmark on the CPU and checks the result.

type DataSource

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

DataSource defines the training dataset for the xor operation.

func NewDataSource

func NewDataSource(to tensor.Operator) *DataSource

NewDataSource creates a new XOR datasource

func (*DataSource) NextBatch

func (ds *DataSource) NextBatch(batchSize int) (
	data tensor.Tensor,
	label []int,
)

NextBatch returns the next batch data.

func (*DataSource) Rewind

func (ds *DataSource) Rewind()

Rewind moves the pointer to the beginning of the training set.

Jump to

Keyboard shortcuts

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