return a scipy sparse matrix for the deriv (a bit silly - it is dense, but nicer for multiplication). Init Regularization with a nP

This commit is contained in:
Lindsey Heagy
2016-05-28 15:40:28 -07:00
parent 341b98d23a
commit e8e022fcc6
2 changed files with 16 additions and 8 deletions
+3 -3
View File
@@ -19,7 +19,7 @@ class IdentityMap(object):
Utils.setKwargs(self, **kwargs)
if nP is not None:
assert type(nP) in [int, long], ' Number of parameters must be an integer.'
assert type(nP) in [int, long, np.int64], ' Number of parameters must be an integer.'
self.mesh = mesh
self._nP = nP
@@ -1492,7 +1492,7 @@ class ParametrizedBlockInLayer(IdentityMap):
self._validate_m(m) # make sure things are the right sizes
if self.mesh.dim == 2:
return self._deriv2d(m)
return sp.csr_matrix(self._deriv2d(m))
elif self.mesh.dim == 3:
return self._deriv3d(m)
return sp.csr_matrix(self._deriv3d(m))