dataset

package
v0.0.0-...-33a8802 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2021 License: MIT Imports: 14 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LoaderFunctions = map[string]LoaderFunc{
	"tensor":   loadTensor,
	"category": loadCategory,
	"class":    loadClass,
	"links":    loadLinks,
}

LoaderFunctions is.

View Source
var TypeExtensions = map[string]map[string]string{
	"tensor":   map[string]string{"default": ".ten.npy", "csv": ".ten.csv"},
	"category": map[string]string{"default": ".cat.txt"},
	"class":    map[string]string{"default": ".class.txt"},
	"links":    map[string]string{"default": ".links.csv"},
}

TypeExtensions is.

Functions

func DumpTarOpener

func DumpTarOpener(opener *TarOpener) (io.Reader, error)

DumpTarOpener converts a tar opener to a bytes reader.

func RandomString

func RandomString(size int, chars string) string

RandomString returns a random string of given length from a given set of characters.

Types

type Category

type Category struct {
	Name       string
	Categories []string
}

Category is.

func (Category) Subtype

func (f Category) Subtype() string

Subtype is.

func (Category) Type

func (f Category) Type() string

Type is.

type Class

type Class struct {
	Name       string
	Categories []string
}

Class is.

func (Class) Subtype

func (f Class) Subtype() string

Subtype is.

func (Class) Type

func (f Class) Type() string

Type is.

type DataBuffer

type DataBuffer struct {
	Buffer   bytes.Buffer
	ReadOnly bool
}

DataBuffer contains data that can be read and written.

func (*DataBuffer) Close

func (b *DataBuffer) Close() error

Close closes the reader.

func (*DataBuffer) Read

func (b *DataBuffer) Read(p []byte) (n int, err error)

Read reads bytes from the buffer.

func (*DataBuffer) Write

func (b *DataBuffer) Write(p []byte) (n int, err error)

Write writes to the buffer.

type Dataset

type Dataset struct {
	Directory
	Root string
}

Dataset is.

func GenerateFromSchema

func GenerateFromSchema(root string, schema *sch.Schema, sampleNames []string, numNodeInstances int) (*Dataset, error)

GenerateFromSchema is.

func Load

func Load(root string, metadataOnly bool, opener Opener) (*Dataset, error)

Load is.

func (*Dataset) Dump

func (d *Dataset) Dump(root string, opener Opener) error

Dump is.

func (*Dataset) InferSchema

func (d *Dataset) InferSchema() (*sch.Schema, Error)

InferSchema is.

type DefaultOpener

type DefaultOpener struct{}

DefaultOpener is.

func (DefaultOpener) GetDir

func (DefaultOpener) GetDir(root string, relPath string, readOnly bool) ([]string, error)

GetDir is.

func (DefaultOpener) GetFile

func (DefaultOpener) GetFile(root string, relPath string, readOnly bool, binary bool) (io.ReadWriteCloser, error)

GetFile is.

type Directory

type Directory struct {
	Name     string
	Children map[string]File
}

Directory is.

func (Directory) Subtype

func (f Directory) Subtype() string

Subtype is.

func (Directory) Type

func (f Directory) Type() string

Type is.

type Error

type Error interface {
	error
	Path() string
}

Error is.

type File

type File interface {
	Type() string
	Subtype() string
}

File is.

type InstanceID

type InstanceID struct {
	Node  string
	Index int
}

InstanceID is.

type Link struct {
	Src InstanceID
	Dst InstanceID
}

Link is.

type Links struct {
	Name  string
	Links map[Link]interface{}
}

Links is.

func (*Links) IsCyclic

func (f *Links) IsCyclic(undirected bool) bool

IsCyclic is.

func (*Links) IsFanin

func (f *Links) IsFanin(undirected bool) bool

IsFanin is.

func (*Links) IsUndirected

func (f *Links) IsUndirected() bool

IsUndirected is.

func (Links) Subtype

func (f Links) Subtype() string

Subtype is.

func (Links) Type

func (f Links) Type() string

Type is.

type LoaderFunc

type LoaderFunc func(string, string, string, Opener, bool, string) (File, error)

LoaderFunc is.

type Opener

type Opener interface {
	GetFile(root string, relPath string, readOnly bool, binary bool) (io.ReadWriteCloser, error)
	GetDir(root string, relPath string, readOnly bool) ([]string, error)
}

Opener is.

type TarDir

type TarDir map[string]interface{}

TarDir is.

type TarOpener

type TarOpener struct {
	Root TarDir
}

TarOpener is.

func LoadTarOpener

func LoadTarOpener(reader *tar.Reader) (*TarOpener, error)

LoadTarOpener instantiates a new TarOpener from the given tar reader.

func NewTarOpener

func NewTarOpener() *TarOpener

NewTarOpener creates a new empty tar opener.

func (*TarOpener) GetDir

func (opener *TarOpener) GetDir(root string, relPath string, readOnly bool) ([]string, error)

GetDir is.

func (*TarOpener) GetFile

func (opener *TarOpener) GetFile(root string, relPath string, readOnly bool, binary bool) (io.ReadWriteCloser, error)

GetFile is.

type Tensor

type Tensor struct {
	Name       string
	Dimensions []int
	Data       interface{}
	// contains filtered or unexported fields
}

Tensor is.

func (Tensor) Subtype

func (f Tensor) Subtype() string

Subtype is.

func (Tensor) Type

func (f Tensor) Type() string

Type is.

Jump to

Keyboard shortcuts

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