Skip to content

Commit

Permalink
fix: change scipy.weave to weave
Browse files Browse the repository at this point in the history
References: HIPS#105
  • Loading branch information
nebgnahz committed May 25, 2017
1 parent 9525e61 commit ac71b61
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions spearmint/kernels/kernel_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@


import numpy as np
import scipy.weave
import weave
from scipy.spatial.distance import cdist

def dist2(ls, x1, x2=None):
Expand Down Expand Up @@ -229,8 +229,8 @@ def grad_dist2(ls, x1, x2=None):
for (int d=0; d<D; d++)
gX(i,j,d) = (2/ls(d))*(x1(i,d) - x2(j,d));
"""
scipy.weave.inline(code, ['x1','x2','gX','ls','M','N','D'], \
type_converters=scipy.weave.converters.blitz, \
weave.inline(code, ['x1','x2','gX','ls','M','N','D'], \
type_converters=weave.converters.blitz, \
compiler='gcc')

# The C code weave above is 10x faster than this:
Expand Down
2 changes: 1 addition & 1 deletion spearmint/models/gp_classifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@
import scipy.optimize as spo
import scipy.io as sio
import scipy.stats as sps
import scipy.weave
import weave
from collections import defaultdict

from .gp import GP
Expand Down
6 changes: 3 additions & 3 deletions spearmint/utils/linalg.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@


import numpy as np
import scipy.weave
import weave
import scipy.linalg as spla

# Update Cholesky decomposition to include a single extra
Expand Down Expand Up @@ -237,8 +237,8 @@ def fast_chol_add(L, A):
}
}
"""
scipy.weave.inline(code, ['U','A','j','isPosDef','rows','cols'], \
type_converters=scipy.weave.converters.blitz, \
weave.inline(code, ['U','A','j','isPosDef','rows','cols'], \
type_converters=weave.converters.blitz, \
compiler='gcc')
except:
k = np.arange(cols)
Expand Down

0 comments on commit ac71b61

Please sign in to comment.