Permalink
Browse files

Rename trace to matrixTrace to avoid name clash

  • Loading branch information...
1 parent 282121b commit f2e8a1941a93fe009c0033a1b4858b966a84fe78 @batterseapower committed Sep 13, 2008
Showing with 3 additions and 3 deletions.
  1. +2 −2 Algorithms/MachineLearning/LinearAlgebra.hs
  2. +1 −1 Algorithms/MachineLearning/LinearRegression.hs
@@ -80,5 +80,5 @@ matrixToVector m
| otherwise
= error "matrixToVector: matrix is neither a row or column vector"
-trace :: Element a => Matrix a -> a
-trace = vectorSum . takeDiag
+matrixTrace :: Element a => Matrix a -> a
+matrixTrace = vectorSum . takeDiag
@@ -224,5 +224,5 @@ convergeOnEMBayesianLinearModel loop_worker design_matrix initial_alpha initial_
-- dE(W) K T T
-- ------- = \Sigma W * W = Tr (W * W)
-- d\alpha k = 1 k k
- alpha' = gamma / (trace $ (trans weights) <> weights)
+ alpha' = gamma / (matrixTrace $ (trans weights) <> weights)
beta' = beta_numerator / modelSumSquaredError linear_model ds

0 comments on commit f2e8a19

Please sign in to comment.