Documentation
¶
Index ¶
- type Binary
- type Huber
- type MSE
- func (m *MSE) ErrorCPU(generated, target []float32) []float32
- func (m *MSE) ErrorGPU(h *cudnn.Handler, dx, y, dy *layers.Tensor) error
- func (m *MSE) ErrorGPUEX(h *cudnn.Handler, x, dx, y *layers.Tensor) error
- func (m *MSE) Loss() float32
- func (m *MSE) NumAlphaScalars() int
- func (m *MSE) NumBetaScalars() int
- func (m *MSE) SetAlphaScalars(alphas []float64) error
- func (m *MSE) SetBetaScalars(betas []float64) error
- type MSE2
- type SoftMax
- func (s SoftMax) BatchLossCPU(actual, desired []float32, batchsize, classificationsize int) (percent, loss float32)
- func (s SoftMax) EpocLossCPU(actual, desired [][]float32, batchsize, classificationsize int) (percent, loss float32)
- func (s SoftMax) EpocLossFromBatchLosses(percentb, lossb []float32) (percent, loss float32)
- func (s *SoftMax) GetAverageBatchLoss() float32
- func (s *SoftMax) Inference(x, y *layers.Tensor) (err error)
- func (s *SoftMax) PerformError(x, dx, y, target *layers.Tensor) (err error)
- func (s *SoftMax) TestForward(x, y, target *layers.Tensor) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Binary ¶
type Binary struct { }
Binary Struct holds the binary loss and derivative calculations
func MakeBinaryCalculator ¶
func MakeBinaryCalculator() Binary
MakeBinaryCalculator returns a Binary struct used to calculate binary stuff
func (Binary) DerivativeNBatched ¶
DerivativeNBatched returns the binary derivative for N batches
func (Binary) DerivativeNSeperated ¶
DerivativeNSeperated is the derivative seperated on the batches
type Huber ¶
type Huber struct { }
Huber holds the methods to do the huber loss
func MakeHuberCalculator ¶
func MakeHuberCalculator() Huber
MakeHuberCalculator returns a Huber so that Huber calculations can be made
type MSE ¶
type MSE struct {
// contains filtered or unexported fields
}
MSE is Mean Squared Error
func CreateMSECalculatorGPU ¶
CreateMSECalculatorGPU creates a mean squared error calculator for gpu memory
func (*MSE) ErrorGPU ¶
ErrorGPU does the error calculation y will have to contain.
y = NetworkOutput
dy = target
dx returns the errors.
func (*MSE) ErrorGPUEX ¶
ErrorGPUEX y is the target values. x is the network output. errors will be put into dx.Volume. The target values are in y.Volume
func (*MSE) NumAlphaScalars ¶
NumAlphaScalars returns the number of scalars the activation layer has both the forward and backward propigation.
func (*MSE) NumBetaScalars ¶
NumBetaScalars returns the number of scalars the activation layer has both the forward and backward propigation.
func (*MSE) SetAlphaScalars ¶
SetAlphaScalars sets the alpha scalers for the forward and backward in that order in the array
func (*MSE) SetBetaScalars ¶
SetBetaScalars sets the beta scalers for the forward and backward in that order in the array
type MSE2 ¶
type MSE2 struct {
// contains filtered or unexported fields
}
MSE2 tries to do the mse with out calling kernel outside of cudnn
func CreateMSE2 ¶
CreateMSE2 creates a mse2 function
func (*MSE2) GetAverageBatchLoss ¶
GetAverageBatchLoss gets the averagebatchloss It also satisfies the gocunets.LossLayer interface
func (*MSE2) GetBatchLoss ¶
GetBatchLoss gets the loss by batch It also satisfies the gocunets.LossLayer interface
func (*MSE2) PerformError ¶
PerformError performs the error PerformError satisfies the loss layer interface
type SoftMax ¶
type SoftMax struct {
// contains filtered or unexported fields
}
SoftMax Holds the methods to do softmax loss
func CreateSoftMax ¶
CreateSoftMax creates the soft max function
func MakeSoftMaxLossCalculator ¶
func MakeSoftMaxLossCalculator() SoftMax
MakeSoftMaxLossCalculator returns a loss calculator for softmax
func (SoftMax) BatchLossCPU ¶
func (s SoftMax) BatchLossCPU(actual, desired []float32, batchsize, classificationsize int) (percent, loss float32)
BatchLossCPU takes the actual and desired arrays in the form of i=batchindex, j=classindex actual[i*classificationsize+j]
func (SoftMax) EpocLossCPU ¶
func (s SoftMax) EpocLossCPU(actual, desired [][]float32, batchsize, classificationsize int) (percent, loss float32)
EpocLossCPU returns the loss epoc if BatchLoss was not calculated.
func (SoftMax) EpocLossFromBatchLosses ¶
EpocLossFromBatchLosses takes an arrays of percent and loss accumulated over the batches and returns total loss over those batches
func (*SoftMax) GetAverageBatchLoss ¶
GetAverageBatchLoss gets the averagebatchloss
func (*SoftMax) PerformError ¶
PerformError performs softmax error