简体   繁体   English

F#向量rowvector乘法问题

[英]F# vector rowvector multiplication issue

I need to multiply a Vector by a RowVector to get a Matrix as the result. 我需要将Vector乘以RowVector以获得矩阵作为结果。 But the F# libraries do not have such an implementation for the * operator. 但是F#库对*运算符没有这样的实现。 How can I do this? 我怎样才能做到这一点?

//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

UPD: UPD:

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

Why do you think the powerpack doesn't implement Vector * RowVector = Matrix ? 您为什么认为Vector * RowVector = Matrix没有实现Vector * RowVector = Matrix

Taken from matrix.fsi 取自matrix.fsi

/// Multiply a column vector and a row vector to produce a matrix
static member ( * )   : Vector<'T>    * RowVector<'T> -> Matrix<'T>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM