preprocessor

package
v0.26.28 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertDivisorToFloat32SliceTensor

func ConvertDivisorToFloat32SliceTensor(columns interface{}) (*tf.Tensor, error)

func ConvertImageToFloat32SliceTensor added in v0.26.28

func ConvertImageToFloat32SliceTensor(columns interface{}) (*tf.Tensor, error)

func ConvertInt32SliceToTensor

func ConvertInt32SliceToTensor(columns interface{}) (*tf.Tensor, error)

func ConvertInterfaceFloat32SliceToTensor added in v0.26.28

func ConvertInterfaceFloat32SliceToTensor(columns interface{}) (*tf.Tensor, error)

func ConvertInterfaceInt32SliceToTensor added in v0.26.28

func ConvertInterfaceInt32SliceToTensor(columns interface{}) (*tf.Tensor, error)

func ConvertInterfaceToFloat32SliceTensor added in v0.26.28

func ConvertInterfaceToFloat32SliceTensor(columns interface{}) (*tf.Tensor, error)

func ConvertInterfaceToInt32SliceTensor added in v0.26.28

func ConvertInterfaceToInt32SliceTensor(columns interface{}) (*tf.Tensor, error)

func ConvertTokenizerToFloat32SliceTensor

func ConvertTokenizerToFloat32SliceTensor(columns interface{}) (*tf.Tensor, error)

func ConvertTokenizerToInt32SliceTensor

func ConvertTokenizerToInt32SliceTensor(columns interface{}) (*tf.Tensor, error)

func ReadCsvFloat32s

func ReadCsvFloat32s(columns []string) interface{}

func ReadCsvInt32s

func ReadCsvInt32s(columns []string) interface{}

func ReadJpg added in v0.26.28

func ReadJpg(columns []string) interface{}

func ReadStringNop

func ReadStringNop(columns []string) interface{}

Types

type Image added in v0.26.28

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

func NewImage added in v0.26.28

func NewImage(
	errorHandler *cberrors.ErrorsContainer,
	configs ...ImageConfig,
) *Image

func (*Image) Process added in v0.26.28

func (i *Image) Process(img image.Image) (ProcessedImage, error)

type ImageColor added in v0.26.28

type ImageColor string
var (
	ImageColorGray ImageColor = "gray"
	ImageColorRGBA ImageColor = "rgba"
	ImageColorRGB  ImageColor = "rgb"
)

type ImageConfig added in v0.26.28

type ImageConfig struct {
	ColorMode     ImageColor
	ResizeX       int
	ResizeY       int
	Interpolation resize.InterpolationFunction
}

type ProcessedImage added in v0.26.28

type ProcessedImage struct {
	Color ImageColor
	Image image.Image
}

type Processor

type Processor struct {
	Name       string
	LineOffset int
	// TODO: find a nicer way to capture multiple columns in a row
	DataLength  int
	RequiresFit bool
	// contains filtered or unexported fields
}

func NewBinaryTokenizingYProcessor added in v0.26.28

func NewBinaryTokenizingYProcessor(
	errorHandler *cberrors.ErrorsContainer,
	cacheDir string,
	lineOffset int,
) *Processor

func NewBinaryYProcessor added in v0.26.28

func NewBinaryYProcessor(
	errorHandler *cberrors.ErrorsContainer,
	cacheDir string,
	lineOffset int,
) *Processor

func NewProcessor

func NewProcessor(
	errorHandler *cberrors.ErrorsContainer,
	name string,
	config ProcessorConfig,
) *Processor

func NewSparseCategoricalTokenizingYProcessor added in v0.26.28

func NewSparseCategoricalTokenizingYProcessor(
	errorHandler *cberrors.ErrorsContainer,
	cacheDir string,
	lineOffset int,
) *Processor

func NewSparseCategoricalYProcessor added in v0.26.28

func NewSparseCategoricalYProcessor(
	errorHandler *cberrors.ErrorsContainer,
	cacheDir string,
	lineOffset int,
) *Processor

func (*Processor) FinishFit

func (p *Processor) FinishFit() error

func (*Processor) FitInterface added in v0.26.28

func (p *Processor) FitInterface(column interface{}) error

func (*Processor) FitString added in v0.26.28

func (p *Processor) FitString(column []string) error

func (*Processor) Load

func (p *Processor) Load() error

func (*Processor) ProcessInterface added in v0.26.28

func (p *Processor) ProcessInterface(columnRows interface{}) (*tf.Tensor, error)

func (*Processor) ProcessString added in v0.26.28

func (p *Processor) ProcessString(columnRows []string) (*tf.Tensor, error)

func (*Processor) Save added in v0.26.28

func (p *Processor) Save(saveDir string) error

func (*Processor) SetLoadDir added in v0.26.28

func (p *Processor) SetLoadDir(dir string)

func (*Processor) Tokenizer added in v0.26.28

func (p *Processor) Tokenizer() *Tokenizer

type ProcessorConfig added in v0.26.28

type ProcessorConfig struct {
	CacheDir    string
	LineOffset  int
	DataLength  int
	RequiresFit bool
	Divisor     *RegressionDivisor
	Tokenizer   *Tokenizer
	Image       *Image
	Reader      func(column []string) interface{}
	Converter   func(column interface{}) (*tf.Tensor, error)
}

type RegressionDivisor

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

func NewDivisor

func NewDivisor(
	errorHandler *cberrors.ErrorsContainer,
) *RegressionDivisor

func (*RegressionDivisor) Divide

func (r *RegressionDivisor) Divide(input []float32) ([]float32, error)

func (*RegressionDivisor) Fit

func (r *RegressionDivisor) Fit(input []float32)

func (*RegressionDivisor) Load

func (r *RegressionDivisor) Load(configFile string) error

func (*RegressionDivisor) Save

func (r *RegressionDivisor) Save(configFile string) error

type Tokenizer

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

func NewTokenizer

func NewTokenizer(
	errorHandler *cberrors.ErrorsContainer,
	maxLen int,
	numWords int,
	configs ...TokenizerConfig,
) *Tokenizer

func (*Tokenizer) FinishFit

func (t *Tokenizer) FinishFit()

func (*Tokenizer) Fit

func (t *Tokenizer) Fit(sentence string)

func (*Tokenizer) Load

func (t *Tokenizer) Load(configFile string) error

func (*Tokenizer) MaxLen added in v0.26.28

func (t *Tokenizer) MaxLen() int

func (*Tokenizer) NumWords added in v0.26.28

func (t *Tokenizer) NumWords() int

func (*Tokenizer) Save

func (t *Tokenizer) Save(configFile string) error

func (*Tokenizer) Tokenize

func (t *Tokenizer) Tokenize(sentence string) []int32

type TokenizerConfig added in v0.26.28

type TokenizerConfig struct {
	IsCategoryTokenizer bool
	Filters             string
	DisableFiltering    bool
}

Jump to

Keyboard shortcuts

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