コード例 #1
0
ファイル: kitchensink.go プロジェクト: reggo/reggo
// PredictBatch makes a prediction for all of the inputs given in inputs concurrently.
// outputs must either be (nSamples x outputDim), or must be nil. If outputs is nil,
// a new matrix will be created to store the predictions
func (sink *Sink) PredictBatch(inputs common.RowMatrix, outputs common.MutableRowMatrix) (common.MutableRowMatrix, error) {
	batch := batchPredictor{
		features:       sink.features,
		featureWeights: sink.featureWeights,
		b:              sink.b,
	}
	return predHelp.BatchPredict(batch, inputs, outputs, sink.inputDim, sink.outputDim, sink.grainSize())
}
コード例 #2
0
ファイル: polynomial.go プロジェクト: reggo/reggo
func (s *Independent) PredictBatch(inputs common.RowMatrix, outputs common.MutableRowMatrix) (common.MutableRowMatrix, error) {
	batch := batchPredictor{
		featureWeights: s.featureWeights,
		outputDim:      s.outputDim,
		nFeatures:      s.nFeatures,
		order:          s.order,
	}
	return predHelp.BatchPredict(batch, inputs, outputs, s.inputDim, s.outputDim, s.grainSize())
}