0

我需要将 Vector 乘以 RowVector 以获得 Matrix 作为结果。但是 F# 库没有针对 * 运算符的这种实现。我怎样才能做到这一点?

//wj(t+1)=wj(t) - a * (yk-dk)* xjk
let weightsDeltaRule (w : matrix, x : vector, y : vector, d : vector) (a : float) = 
    let delta = y - d
    w - a * (Vector.transpose x) * delta

升级版:

vector<'T> *  rowvec<'T> -> matrix<'T>
rowvec<'T> * vector<'T> -> 'T
4

1 回答 1

2

为什么你认为 powerpack 没有实现Vector * RowVector = Matrix

摘自matrix.fsi

/// Multiply a column vector and a row vector to produce a matrix
static member ( * )   : Vector<'T>    * RowVector<'T> -> Matrix<'T>
于 2013-10-04T21:12:37.130 回答