Versions in this module Expand all Collapse all v0 v0.0.2 May 25, 2024 v0.0.1 Mar 7, 2024 Changes in this version + const SEP + func BCELoss(logits, target *ts.Tensor, opts ...LossFnOption) *ts.Tensor + func BatchAccuracyForLogits(vs *VarStore, m ts.ModuleT, xs, ys *ts.Tensor, d gotch.Device, batchSize int) (retVal float64) + func BatchAccuracyForLogitsIdx(vs *VarStore, m ts.ModuleT, xs, ys *ts.Tensor, d gotch.Device, batchSize int) (retVal float64) + func BatchAccuracyForLogitsOld(vs *VarStore, m ts.ModuleT, xs, ys *ts.Tensor, d gotch.Device, batchSize int) (retVal float64) + func CalculateFans(shape []int64) (fanIn, fanOut int64, err error) + func CrossEntropyLoss(logits, target *ts.Tensor, opts ...LossFnOption) *ts.Tensor + func MSELoss(logits, labels *ts.Tensor, reductionOpt ...int64) *ts.Tensor + func NewBuffer(path *Path, name string, x *ts.Tensor, persistentOpt ...bool) *ts.Tensor + func NewConstInit(v float64) constInit + func NewGlorotNInit() glorotNInit + func NewKaimingUniformInit(opts ...KaimingOption) *kaimingUniformInit + func NewParameter(path *Path, name string, x *ts.Tensor, requireGradOpt ...bool) *ts.Tensor + func NewRandnInit(mean, stdev float64) randnInit + func NewUniformInit(lo, up float64) uniformInit + func WithUint8(n uint8) func() uint8 + func XavierUniform_(x *ts.Tensor, gainOpt ...float64) + type AdamConfig struct + Beta1 float64 + Beta2 float64 + Wd float64 + func DefaultAdamConfig() *AdamConfig + func NewAdamConfig(beta1, beta2, wd float64) *AdamConfig + func (c *AdamConfig) Build(vs *VarStore, lr float64) (*Optimizer, error) + type AdamWConfig struct + Beta1 float64 + Beta2 float64 + Wd float64 + func DefaultAdamWConfig() *AdamWConfig + func NewAdamWConfig(beta1, beta2, wd float64) *AdamWConfig + func (c *AdamWConfig) Build(vs *VarStore, lr float64) (*Optimizer, error) + type AddOpt func(*AddOpts) + func WithPersistent(v bool) AddOpt + func WithVarType(v string) AddOpt + type AddOpts struct + Persistent bool + VarType string + type BatchNorm struct + Bs *ts.Tensor + Nd uint + RunningMean *ts.Tensor + RunningVar *ts.Tensor + Ws *ts.Tensor + func BatchNorm1D(vs *Path, outDim int64, config *BatchNormConfig) *BatchNorm + func BatchNorm2D(vs *Path, outDim int64, config *BatchNormConfig) *BatchNorm + func BatchNorm3D(vs *Path, outDim int64, config *BatchNormConfig) *BatchNorm + func NewBatchNorm(vs *Path, nd uint, outDim int64, config *BatchNormConfig) *BatchNorm + func (bn *BatchNorm) Forward(xs *ts.Tensor) (retVal *ts.Tensor) + func (bn *BatchNorm) ForwardT(xs *ts.Tensor, train bool) (retVal *ts.Tensor) + type BatchNormConfig struct + BsInit Init + CudnnEnable bool + Eps float64 + Momentum float64 + WsInit Init + func DefaultBatchNormConfig() *BatchNormConfig + type ClipOpt func(*ClipOpts) + func WithErrorIfNonFinite(v bool) ClipOpt + func WithNormType(v float64) ClipOpt + type ClipOpts struct + ErrorIfNonFinite bool + NormType float64 + type Conv interface + func NewConv(vs *Path, inDim, outDim int64, ksizes []int64, config interface{}) Conv + type Conv1D struct + Bs *ts.Tensor + Config *Conv1DConfig + Ws *ts.Tensor + func NewConv1D(vs *Path, inDim, outDim, k int64, cfg *Conv1DConfig) *Conv1D + func (c *Conv1D) Forward(xs *ts.Tensor) *ts.Tensor + func (c *Conv1D) ForwardT(xs *ts.Tensor, train bool) *ts.Tensor + type Conv1DConfig struct + Bias bool + BsInit Init + Dilation []int64 + Groups int64 + Padding []int64 + Stride []int64 + WsInit Init + func DefaultConv1DConfig() *Conv1DConfig + func NewConv1DConfig(opts ...Conv1DConfigOpt) *Conv1DConfig + type Conv1DConfigOpt func(*Conv1DConfig) + func WithBias1D(val bool) Conv1DConfigOpt + func WithBsInit1D(val Init) Conv1DConfigOpt + func WithDilation1D(val int64) Conv1DConfigOpt + func WithGroup1D(val int64) Conv1DConfigOpt + func WithPadding1D(val int64) Conv1DConfigOpt + func WithStride1D(val int64) Conv1DConfigOpt + func WithWsInit1D(val Init) Conv1DConfigOpt + type Conv2D struct + Bs *ts.Tensor + Config *Conv2DConfig + Ws *ts.Tensor + func NewConv2D(vs *Path, inDim, outDim int64, k int64, cfg *Conv2DConfig) *Conv2D + func (c *Conv2D) Forward(xs *ts.Tensor) *ts.Tensor + func (c *Conv2D) ForwardT(xs *ts.Tensor, train bool) *ts.Tensor + type Conv2DConfig struct + Bias bool + BsInit Init + Dilation []int64 + Groups int64 + Padding []int64 + Stride []int64 + WsInit Init + func DefaultConv2DConfig() *Conv2DConfig + func NewConv2DConfig(opts ...Conv2DConfigOpt) *Conv2DConfig + type Conv2DConfigOpt func(*Conv2DConfig) + func WithBias2D(val bool) Conv2DConfigOpt + func WithBsInit2D(val Init) Conv2DConfigOpt + func WithDilation2D(val int64) Conv2DConfigOpt + func WithGroup2D(val int64) Conv2DConfigOpt + func WithPadding2D(val int64) Conv2DConfigOpt + func WithStride2D(val int64) Conv2DConfigOpt + func WithWsInit2D(val Init) Conv2DConfigOpt + type Conv3D struct + Bs *ts.Tensor + Config *Conv3DConfig + Ws *ts.Tensor + func NewConv3D(vs *Path, inDim, outDim, k int64, cfg *Conv3DConfig) *Conv3D + func (c *Conv3D) Forward(xs *ts.Tensor) *ts.Tensor + func (c *Conv3D) ForwardT(xs *ts.Tensor, train bool) *ts.Tensor + type Conv3DConfig struct + Bias bool + BsInit Init + Dilation []int64 + Groups int64 + Padding []int64 + Stride []int64 + WsInit Init + func DefaultConv3DConfig() *Conv3DConfig + func NewConv3DConfig(opts ...Conv3DConfigOpt) *Conv3DConfig + type Conv3DConfigOpt func(*Conv3DConfig) + func WithBias3D(val bool) Conv3DConfigOpt + func WithBsInit3D(val Init) Conv3DConfigOpt + func WithDilation3D(val int64) Conv3DConfigOpt + func WithGroup3D(val int64) Conv3DConfigOpt + func WithPadding3D(val int64) Conv3DConfigOpt + func WithStride3D(val int64) Conv3DConfigOpt + func WithWsInit3D(val Init) Conv3DConfigOpt + type ConvTranspose1D struct + Bs *ts.Tensor + Config *ConvTranspose1DConfig + Ws *ts.Tensor + func NewConvTranspose1D(vs *Path, inDim, outDim int64, ksizes []int64, cfg *ConvTranspose1DConfig) *ConvTranspose1D + func (c *ConvTranspose1D) Forward(xs *ts.Tensor) *ts.Tensor + type ConvTranspose1DConfig struct + Bias bool + BsInit Init + Dilation []int64 + Groups int64 + OutputPadding []int64 + Padding []int64 + Stride []int64 + WsInit Init + func DefaultConvTranspose1DConfig() *ConvTranspose1DConfig + type ConvTranspose2D struct + Bs *ts.Tensor + Config *ConvTranspose2DConfig + Ws *ts.Tensor + func NewConvTranspose2D(vs *Path, inDim, outDim int64, ksizes []int64, cfg *ConvTranspose2DConfig) *ConvTranspose2D + func (c *ConvTranspose2D) Forward(xs *ts.Tensor) *ts.Tensor + type ConvTranspose2DConfig struct + Bias bool + BsInit Init + Dilation []int64 + Groups int64 + OutputPadding []int64 + Padding []int64 + Stride []int64 + WsInit Init + type ConvTranspose3D struct + Bs *ts.Tensor + Config *ConvTranspose3DConfig + Ws *ts.Tensor + func NewConvTranspose3D(vs *Path, inDim, outDim int64, ksizes []int64, cfg *ConvTranspose3DConfig) *ConvTranspose3D + func (c *ConvTranspose3D) Forward(xs *ts.Tensor) *ts.Tensor + type ConvTranspose3DConfig struct + Bias bool + BsInit Init + Dilation []int64 + Groups int64 + OutputPadding []int64 + Padding []int64 + Stride []int64 + WsInit Init + type CosineAnnealingLR struct + func NewCosineAnnealingLR(opt *Optimizer, tmax int, etaMin float64) *CosineAnnealingLR + func (ca *CosineAnnealingLR) Build() *LRScheduler + func (ca *CosineAnnealingLR) SetLRs(opts ...SchedulerOption) + type CosineAnnealingWarmRestarts struct + func NewCosineAnnealingWarmRestarts(opt *Optimizer, t0 int, opts ...CosineAnnealingWarmRestartsOption) *CosineAnnealingWarmRestarts + func (s *CosineAnnealingWarmRestarts) Build() *LRScheduler + func (s *CosineAnnealingWarmRestarts) SetLRs(opts ...SchedulerOption) + type CosineAnnealingWarmRestartsOption func(*CosineAnnealingWarmRestartsOptions) + func WithCosineAnnealingLastEpoch(v int) CosineAnnealingWarmRestartsOption + func WithEtaMin(v float64) CosineAnnealingWarmRestartsOption + func WithTMult(v int) CosineAnnealingWarmRestartsOption + type CosineAnnealingWarmRestartsOptions struct + EtaMin float64 + LastEpoch int + TMult int + type CyclicLR struct + func NewCyclicLR(opt *Optimizer, baseLRs, maxLRs []float64, opts ...CyclicOption) *CyclicLR + func (cyc *CyclicLR) Build() *LRScheduler + func (cyc *CyclicLR) SetLRs(opts ...SchedulerOption) + type CyclicOption func(*CyclicOptions) + func WithCyclicBaseMomentum(v float64) CyclicOption + func WithCyclicCycleMomentum(v bool) CyclicOption + func WithCyclicGamma(v float64) CyclicOption + func WithCyclicLastEpoch(v int) CyclicOption + func WithCyclicMaxMomentum(v float64) CyclicOption + func WithCyclicMode(v string) CyclicOption + func WithCyclicScaleFn(v func(x float64) float64) CyclicOption + func WithCyclicScaleMode(v string) CyclicOption + func WithCyclicStepSizeDown(v int) CyclicOption + func WithCyclicStepSizeUp(v int) CyclicOption + type CyclicOptions struct + BaseMomentum float64 + CycleMomentum bool + Gamma float64 + LastEpoch int + MaxMomentum float64 + Mode string + ScaleFn func(x float64) float64 + ScaleMode string + StepSizeDown int + StepSizeUp int + type Dropout struct + func NewDropout(p float64) *Dropout + func (d *Dropout) ForwardT(input *ts.Tensor, train bool) (retVal *ts.Tensor) + type Embedding struct + Ws *ts.Tensor + func NewEmbedding(vs *Path, numEmbeddings int64, embeddingDim int64, config *EmbeddingConfig) *Embedding + func (e *Embedding) Forward(xs *ts.Tensor) *ts.Tensor + func (e *Embedding) ForwardT(xs *ts.Tensor, train bool) *ts.Tensor + type EmbeddingConfig struct + PaddingIdx int64 + ScaleGradByFreq bool + Sparse bool + WsInit Init + func DefaultEmbeddingConfig() *EmbeddingConfig + type Entry struct + func (e *Entry) MustOrKaimingUniform(dims []int64, opts ...AddOpt) *ts.Tensor + func (e *Entry) MustOrOnes(dims []int64, opts ...AddOpt) *ts.Tensor + func (e *Entry) MustOrOnesNoTrain(dims []int64, opts ...AddOpt) *ts.Tensor + func (e *Entry) MustOrRandn(dims []int64, mean, stdev float64, opts ...AddOpt) *ts.Tensor + func (e *Entry) MustOrRandnStandard(dims []int64, opts ...AddOpt) *ts.Tensor + func (e *Entry) MustOrUniform(dims []int64, lo, up float64, opts ...AddOpt) *ts.Tensor + func (e *Entry) MustOrVar(dims []int64, init Init, opts ...AddOpt) *ts.Tensor + func (e *Entry) MustOrVarCopy(tensor *ts.Tensor) *ts.Tensor + func (e *Entry) MustOrZeros(dims []int64, opts ...AddOpt) *ts.Tensor + func (e *Entry) MustOrZerosNoTrain(dims []int64, opts ...AddOpt) *ts.Tensor + func (e *Entry) OrKaimingUniform(dims []int64, opts ...AddOpt) (*ts.Tensor, error) + func (e *Entry) OrOnes(dims []int64, opts ...AddOpt) (*ts.Tensor, error) + func (e *Entry) OrOnesNoTrain(dims []int64, opts ...AddOpt) (*ts.Tensor, error) + func (e *Entry) OrRandn(dims []int64, mean, stdev float64, opts ...AddOpt) (*ts.Tensor, error) + func (e *Entry) OrRandnStandard(dims []int64, opts ...AddOpt) (*ts.Tensor, error) + func (e *Entry) OrUniform(dims []int64, lo, up float64, opts ...AddOpt) (*ts.Tensor, error) + func (e *Entry) OrVar(dims []int64, init Init, opts ...AddOpt) (*ts.Tensor, error) + func (e *Entry) OrVarCopy(tensor *ts.Tensor) (*ts.Tensor, error) + func (e *Entry) OrZeros(dims []int64, opts ...AddOpt) (*ts.Tensor, error) + func (e *Entry) OrZerosNoTrain(dims []int64, opts ...AddOpt) (*ts.Tensor, error) + type ExponentialLR struct + func NewExponentialLR(opt *Optimizer, gamma float64) *ExponentialLR + func (e *ExponentialLR) Build() *LRScheduler + func (e *ExponentialLR) SetLRs(opts ...SchedulerOption) + type ForwardTWith func(*ts.Tensor, bool) *ts.Tensor + func (fw ForwardTWith) ForwardT(xs *ts.Tensor, train bool) *ts.Tensor + type ForwardWith func(*ts.Tensor) *ts.Tensor + func (fw ForwardWith) Forward(xs *ts.Tensor) *ts.Tensor + type Func struct + func NewFunc(fn func(*ts.Tensor) *ts.Tensor) (retVal Func) + func (fn Func) Forward(xs *ts.Tensor) (retVal *ts.Tensor) + func (fn Func) ForwardT(xs *ts.Tensor, train bool) (retVal *ts.Tensor) + type FuncT struct + func NewFuncT(fn func(*ts.Tensor, bool) *ts.Tensor) (retVal FuncT) + func (fn FuncT) ForwardT(xs *ts.Tensor, train bool) (retVal *ts.Tensor) + type GRU struct + func NewGRU(vs *Path, inDim, hiddenDim int64, cfg *RNNConfig) (retVal *GRU) + func (g *GRU) Seq(input *ts.Tensor) (*ts.Tensor, State) + func (g *GRU) SeqInit(input *ts.Tensor, inState State) (*ts.Tensor, State) + func (g *GRU) Step(input *ts.Tensor, inState State) State + func (g *GRU) ZeroState(batchDim int64) State + type GRUState struct + Tensor *ts.Tensor + func (gs *GRUState) Value() *ts.Tensor + type Identity struct + func NewIdentity() *Identity + func (m *Identity) Forward(x *ts.Tensor) *ts.Tensor + type Init interface + InitTensor func(dims []int64, device gotch.Device, dtypeOpt ...gotch.DType) (retVal *ts.Tensor) + Set func(tensor *ts.Tensor) + type KaimingOption func(*KaimingOptions) + func WithKaimingMode(v string) KaimingOption + func WithKaimingNegativeSlope(v float64) KaimingOption + func WithKaimingNonLinearity(v string) KaimingOption + type KaimingOptions struct + Mode string + NegativeSlope float64 + NonLinearity string + func DefaultKaimingOptions() *KaimingOptions + func NewKaimingOptions(opts ...KaimingOption) *KaimingOptions + type LRScheduler struct + func NewLRScheduler(s scheduler) *LRScheduler + func (s *LRScheduler) Step(opts ...SchedulerOption) + type LSTM struct + func NewLSTM(vs *Path, inDim, hiddenDim int64, cfg *RNNConfig) *LSTM + func (l *LSTM) Seq(input *ts.Tensor) (*ts.Tensor, State) + func (l *LSTM) SeqInit(input *ts.Tensor, inState State) (*ts.Tensor, State) + func (l *LSTM) Step(input *ts.Tensor, inState State) State + func (l *LSTM) ZeroState(batchDim int64) State + type LSTMState struct + Tensor1 *ts.Tensor + Tensor2 *ts.Tensor + func (ls *LSTMState) C() *ts.Tensor + func (ls *LSTMState) H() *ts.Tensor + type LambdaFn func(in interface{}) float64 + type LambdaLR struct + func NewLambdaLR(opt *Optimizer, ldFns []LambdaFn) *LambdaLR + func (l *LambdaLR) Build() *LRScheduler + func (l *LambdaLR) SetLRs(opts ...SchedulerOption) + type LayerNorm struct + Bs *ts.Tensor + Config *LayerNormConfig + NormalizedShape []int64 + Ws *ts.Tensor + func NewLayerNorm(vs *Path, normalizedShape []int64, config *LayerNormConfig) *LayerNorm + func (ln *LayerNorm) Forward(xs *ts.Tensor) (retVal *ts.Tensor) + type LayerNormConfig struct + BsInit Init + BsName string + CudnnEnable bool + ElementwiseAffine bool + Eps float64 + WsInit Init + WsName string + func DefaultLayerNormConfig() *LayerNormConfig + type Linear struct + Bs *ts.Tensor + Ws *ts.Tensor + func NewLinear(vs *Path, inDim, outDim int64, c *LinearConfig) *Linear + func (l *Linear) Forward(xs *ts.Tensor) (retVal *ts.Tensor) + func (l *Linear) ForwardT(xs *ts.Tensor, train bool) (retVal *ts.Tensor) + type LinearConfig struct + Bias bool + BsInit Init + WsInit Init + func DefaultLinearConfig() *LinearConfig + type LossFnOption func(*lossFnOptions) + func WithLossFnIgnoreIndex(val int64) LossFnOption + func WithLossFnPosWeight(val int64) LossFnOption + func WithLossFnReduction(val int64) LossFnOption + func WithLossFnWeights(vals []float64) LossFnOption + type MaxPool2D struct + CeilMode bool + Dilation []int64 + Kernel []int64 + Padding []int64 + Stride []int64 + func NewMaxPool2D(kernelSize []int64, opts ...MaxPool2DOpt) *MaxPool2D + func (m *MaxPool2D) Forward(x *ts.Tensor) *ts.Tensor + type MaxPool2DOpt func(*MaxPool2DOpts) + func OptCeilModeMp2D(v bool) MaxPool2DOpt + func OptDilationMp2D(v []int64) MaxPool2DOpt + func OptPaddingMp2D(v []int64) MaxPool2DOpt + func OptStrideMp2D(v []int64) MaxPool2DOpt + type MaxPool2DOpts struct + CeilMode bool + Dilation []int64 + Padding []int64 + Stride []int64 + func DefaultMaxPool2DOpts() *MaxPool2DOpts + type MultiStepLR struct + func NewMultiStepLR(opt *Optimizer, milestones []int, gamma float64) *MultiStepLR + func (ms *MultiStepLR) Build() *LRScheduler + func (ms *MultiStepLR) SetLRs(opts ...SchedulerOption) + type MultiplicativeLR struct + func NewMultiplicativeLR(opt *Optimizer, ldFns []LambdaFn) *MultiplicativeLR + func (m *MultiplicativeLR) Build() *LRScheduler + func (m *MultiplicativeLR) SetLRs(opts ...SchedulerOption) + type OneCycleLR struct + func NewOneCycleLR(opt *Optimizer, maxLR float64, opts ...OneCycleOption) *OneCycleLR + func (oc *OneCycleLR) Build() *LRScheduler + func (oc *OneCycleLR) SetLRs(opts ...SchedulerOption) + type OneCycleOption func(*OneCycleOptions) + func WithOneCycleAnnealStrategy(v string) OneCycleOption + func WithOneCycleBaseMomentum(v float64) OneCycleOption + func WithOneCycleCycleMomentum(v bool) OneCycleOption + func WithOneCycleDivFactor(v float64) OneCycleOption + func WithOneCycleEpochs(v int) OneCycleOption + func WithOneCycleFinalDivFactor(v float64) OneCycleOption + func WithOneCycleLastEpoch(v int) OneCycleOption + func WithOneCycleMaxMomentum(v float64) OneCycleOption + func WithOneCyclePctStart(v float64) OneCycleOption + func WithOneCycleStepsPerEpoch(v int) OneCycleOption + func WithOneCycleTotalSteps(v int) OneCycleOption + type OneCycleOptions struct + AnnealStrategy string + BaseMomentum float64 + CycleMomentum bool + DivFactor float64 + Epochs int + FinalDivFactor float64 + LastEpoch int + MaxMomentum float64 + PctStart float64 + StepsPerEpoch int + TotalSteps int + type Optimizer struct + func (opt *Optimizer) AddParamGroup(tensors []*ts.Tensor) + func (opt *Optimizer) BackwardStep(loss *ts.Tensor) error + func (opt *Optimizer) BackwardStepClip(loss *ts.Tensor, max float64) error + func (opt *Optimizer) BackwardStepClipNorm(loss *ts.Tensor, max float64, opts ...ClipOpt) error + func (opt *Optimizer) ClipGradNorm(max float64, opts ...ClipOpt) error + func (opt *Optimizer) ClipGradValue(max float64) + func (opt *Optimizer) GetLRs() []float64 + func (opt *Optimizer) MustBackwardStep(loss *ts.Tensor) + func (opt *Optimizer) MustBackwardStepClip(loss *ts.Tensor, max float64) + func (opt *Optimizer) MustBackwardStepClipNorm(loss *ts.Tensor, max float64, opts ...ClipOpt) + func (opt *Optimizer) MustStep() + func (opt *Optimizer) MustZeroGrad() + func (opt *Optimizer) ParamGroupNum() int + func (opt *Optimizer) ResetStepCount() + func (opt *Optimizer) SetLR(lr float64) + func (opt *Optimizer) SetLRs(lrs []float64) + func (opt *Optimizer) SetMomentum(m float64) + func (opt *Optimizer) Step() error + func (opt *Optimizer) StepCount() int + func (opt *Optimizer) ZeroGrad() error + type OptimizerConfig interface + Build func(vs *VarStore, lr float64) (*Optimizer, error) + type Path struct + func (p *Path) Add(name string, x *ts.Tensor, trainable bool, opts ...AddOpt) (*ts.Tensor, error) + func (p *Path) Device() gotch.Device + func (p *Path) Entry(name string) *Entry + func (p *Path) Get(name string) (*ts.Tensor, error) + func (p *Path) KaimingUniform(name string, dims []int64, opts ...AddOpt) (*ts.Tensor, error) + func (p *Path) MustAdd(name string, x *ts.Tensor, trainable bool, opts ...AddOpt) *ts.Tensor + func (p *Path) MustGet(name string) *ts.Tensor + func (p *Path) MustKaimingUniform(name string, dims []int64, opts ...AddOpt) *ts.Tensor + func (p *Path) MustNewVar(name string, dims []int64, ini Init, opts ...AddOpt) *ts.Tensor + func (p *Path) MustOnes(name string, dims []int64, opts ...AddOpt) *ts.Tensor + func (p *Path) MustOnesNoTrain(name string, dims []int64, opts ...AddOpt) *ts.Tensor + func (p *Path) MustRandn(name string, dims []int64, mean float64, stdev float64, opts ...AddOpt) *ts.Tensor + func (p *Path) MustRandnStandard(name string, dims []int64, opts ...AddOpt) *ts.Tensor + func (p *Path) MustRemove(name string) + func (p *Path) MustUniform(name string, dims []int64, lo, up float64, opts ...AddOpt) *ts.Tensor + func (p *Path) MustVarCopy(name string, t *ts.Tensor) *ts.Tensor + func (p *Path) MustZeros(name string, dims []int64, opts ...AddOpt) *ts.Tensor + func (p *Path) MustZerosNoTrain(name string, dims []int64, opts ...AddOpt) *ts.Tensor + func (p *Path) NewVar(name string, dims []int64, ini Init, opts ...AddOpt) (*ts.Tensor, error) + func (p *Path) Ones(name string, dims []int64, opts ...AddOpt) (*ts.Tensor, error) + func (p *Path) OnesNoTrain(name string, dims []int64, opts ...AddOpt) (*ts.Tensor, error) + func (p *Path) Paths() []string + func (p *Path) Randn(name string, dims []int64, mean float64, stdev float64, opts ...AddOpt) (*ts.Tensor, error) + func (p *Path) RandnStandard(name string, dims []int64, opts ...AddOpt) (*ts.Tensor, error) + func (p *Path) Remove(name string) error + func (p *Path) SetGroup(g uint) + func (p *Path) Sub(str string) *Path + func (p *Path) ToBFloat16() + func (p *Path) ToDType(dtype gotch.DType) + func (p *Path) ToDevice(device gotch.Device) + func (p *Path) ToDouble() + func (p *Path) ToFloat(floatDTypeOpt ...gotch.DType) + func (p *Path) ToHalf() + func (p *Path) Uniform(name string, dims []int64, lo, up float64, opts ...AddOpt) (*ts.Tensor, error) + func (p *Path) VarCopy(name string, t *ts.Tensor) (*ts.Tensor, error) + func (p *Path) Zeros(name string, dims []int64, opts ...AddOpt) (*ts.Tensor, error) + func (p *Path) ZerosNoTrain(name string, dims []int64, opts ...AddOpt) (*ts.Tensor, error) + type RMSPropConfig struct + Alpha float64 + Centered bool + Eps float64 + Momentum float64 + Wd float64 + func DefaultRMSPropConfig() *RMSPropConfig + func NewRMSPropConfig(alpha, eps, wd, momentum float64, centered bool) *RMSPropConfig + func (c *RMSPropConfig) Build(vs *VarStore, lr float64) (*Optimizer, error) + type RNN interface + Seq func(input *ts.Tensor) (*ts.Tensor, State) + SeqInit func(input *ts.Tensor, inState State) (*ts.Tensor, State) + Step func(input *ts.Tensor, inState State) State + ZeroState func(batchDim int64) State + type RNNConfig struct + BatchFirst bool + Bidirectional bool + Dropout float64 + HasBiases bool + NumLayers int64 + Train bool + func DefaultRNNConfig() *RNNConfig + type ReduceLROnPlateau struct + func NewReduceLROnPlateau(opt *Optimizer, opts ...ReduceLROnPlateauOption) *ReduceLROnPlateau + func (s *ReduceLROnPlateau) Build() *LRScheduler + func (s *ReduceLROnPlateau) SetLRs(opts ...SchedulerOption) + type ReduceLROnPlateauOption func(*ReduceLROnPlateauOptions) + func WithReduceOnPlateauCooldown(cooldown int) ReduceLROnPlateauOption + func WithReduceOnPlateauEps(eps float64) ReduceLROnPlateauOption + func WithReduceOnPlateauFactor(factor float64) ReduceLROnPlateauOption + func WithReduceOnPlateauMinLRs(minLRs []float64) ReduceLROnPlateauOption + func WithReduceOnPlateauMode(mode string) ReduceLROnPlateauOption + func WithReduceOnPlateauPatience(patience int) ReduceLROnPlateauOption + func WithReduceOnPlateauThreshold(threshold float64) ReduceLROnPlateauOption + func WithReduceOnPlateauThresholdMode(thresholdMode string) ReduceLROnPlateauOption + func WithReduceOnPlateauVerbose(verbose bool) ReduceLROnPlateauOption + type ReduceLROnPlateauOptions struct + Cooldown int + Eps float64 + Factor float64 + MinLRs []float64 + Mode string + Patience int + Threshold float64 + ThresholdMode string + Verbose bool + type SGDConfig struct + Dampening float64 + Momentum float64 + Nesterov bool + Wd float64 + func DefaultSGDConfig() *SGDConfig + func NewSGDConfig(momentum, dampening, wd float64, nesterov bool) *SGDConfig + func (c *SGDConfig) Build(vs *VarStore, lr float64) (*Optimizer, error) + type SchedulerOption func(*SchedulerOptions) + func WithLastEpoch(epoch int) SchedulerOption + func WithLoss(loss float64) SchedulerOption + type SchedulerOptions struct + LastEpoch int + Loss float64 + func DefaultSchedulerOptions() *SchedulerOptions + type Sequential struct + func Seq() *Sequential + func (s *Sequential) Add(l ts.Module) + func (s *Sequential) AddFn(fn ts.Module) + func (s *Sequential) Forward(xs *ts.Tensor) (retVal *ts.Tensor) + func (s *Sequential) ForwardAll(xs *ts.Tensor, opts ...uint8) (retVal []*ts.Tensor) + func (s *Sequential) IsEmpty() (retVal bool) + func (s *Sequential) Len() (retVal int64) + type SequentialT struct + func SeqT() *SequentialT + func (s *SequentialT) Add(l ts.ModuleT) + func (s *SequentialT) AddFn(fn ts.ModuleT) + func (s *SequentialT) AddFnT(fn ts.ModuleT) + func (s *SequentialT) ForwardAllT(xs *ts.Tensor, train bool, opts ...uint8) (retVal []*ts.Tensor) + func (s *SequentialT) ForwardT(xs *ts.Tensor, train bool) *ts.Tensor + func (s *SequentialT) IsEmpty() (retVal bool) + func (s *SequentialT) Len() (retVal int64) + type State interface + type StepLR struct + func NewStepLR(opt *Optimizer, stepSize int, gamma float64) *StepLR + func (s *StepLR) Build() *LRScheduler + func (s *StepLR) SetLRs(opts ...SchedulerOption) + type TrainableCModule struct + Inner *ts.CModule + func TrainableCModuleLoad(p *Path, file string) (*TrainableCModule, error) + func TrainableCModuleLoadData(p *Path, stream io.Reader) (*TrainableCModule, error) + func (m *TrainableCModule) ForwardT(x *ts.Tensor, train bool) *ts.Tensor + func (m *TrainableCModule) Save(file string) error + func (m *TrainableCModule) SetEval() + func (m *TrainableCModule) SetTrain() + type Var struct + Group uint + Persitent bool + Tensor *ts.Tensor + Trainable bool + Type string + type VarStore struct + func NewVarStore(device gotch.Device) *VarStore + func (vs *VarStore) Copy(src *VarStore) error + func (vs *VarStore) Destroy() + func (vs *VarStore) Device() gotch.Device + func (vs *VarStore) Freeze() error + func (vs *VarStore) IsEmpty() bool + func (vs *VarStore) Len() int + func (vs *VarStore) Load(filepath string) error + func (vs *VarStore) LoadPartial(filepath string) ([]string, error) + func (vs *VarStore) LoadWeights(namedTensors []ts.NamedTensor) error + func (vs *VarStore) LoadWeightsPartial(namedTensors []ts.NamedTensor) ([]string, error) + func (vs *VarStore) Root() *Path + func (vs *VarStore) Save(filepath string) error + func (vs *VarStore) Summary() + func (vs *VarStore) ToBFloat16() + func (vs *VarStore) ToDType(dtype gotch.DType) + func (vs *VarStore) ToDevice(device gotch.Device) + func (vs *VarStore) ToDouble() + func (vs *VarStore) ToFloat() + func (vs *VarStore) ToHalf() + func (vs *VarStore) TrainableVariables() []*ts.Tensor + func (vs *VarStore) Unfreeze() error + func (vs *VarStore) Variables() map[string]ts.Tensor