Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix the bug with summing up the tensor slice fits

  • Loading branch information...
commit 8bb05d43e83e8f5d5d7529e3df1d34512785b8f0 1 parent 98c0e3b
@nzhiltsov authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 extrescal.py
View
6 extrescal.py
@@ -122,8 +122,8 @@ def rescal(X, D, rank, **kwargs):
raise 'Projection via QR decomposition is required; pass proj=true'
# initialize V
- Drow, Dcol = D.shape
- V = array(rand(rank, Dcol), dtype=np.float64)
+ DrowSize, DcolSize = D.shape
+ V = array(rand(rank, DcolSize), dtype=np.float64)
# compute factorization
fit = fitchange = fitold = 0
@@ -165,7 +165,7 @@ def rescal(X, D, rank, **kwargs):
if exactfit:
for i in xrange(len(R)):
- tensorFit = norm(X[i] - dot(A,dot(R[i], A.T)))**2
+ tensorFit += norm(X[i] - dot(A,dot(R[i], A.T)))**2
else :
for i in xrange(len(R)):
ARk = dot(A, R[i])
Please sign in to comment.
Something went wrong with that request. Please try again.