Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions graphtools/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ def Graph(
else:
msg = msg + " and PyGSP inheritance"

_logger.debug(msg)
_logger.log_debug(msg)

class_names = [p.__name__.replace("Graph", "") for p in parent_classes]
try:
Expand All @@ -273,7 +273,7 @@ def Graph(
pass

# build graph and return
_logger.debug(
_logger.log_debug(
"Initializing {} with arguments {}".format(
parent_classes,
", ".join(
Expand Down
12 changes: 6 additions & 6 deletions graphtools/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -498,10 +498,10 @@ def __init__(
self.anisotropy = anisotropy

if initialize:
_logger.debug("Initializing kernel...")
_logger.log_debug("Initializing kernel...")
self.K
else:
_logger.debug("Not initializing kernel.")
_logger.log_debug("Not initializing kernel.")
super().__init__(**kwargs)

def _check_symmetrization(self, kernel_symm, theta):
Expand Down Expand Up @@ -556,18 +556,18 @@ def _build_kernel(self):
def symmetrize_kernel(self, K):
# symmetrize
if self.kernel_symm == "+":
_logger.debug("Using addition symmetrization.")
_logger.log_debug("Using addition symmetrization.")
K = (K + K.T) / 2
elif self.kernel_symm == "*":
_logger.debug("Using multiplication symmetrization.")
_logger.log_debug("Using multiplication symmetrization.")
K = K.multiply(K.T)
elif self.kernel_symm == "mnn":
_logger.debug("Using mnn symmetrization (theta = {}).".format(self.theta))
_logger.log_debug("Using mnn symmetrization (theta = {}).".format(self.theta))
K = self.theta * matrix.elementwise_minimum(K, K.T) + (
1 - self.theta
) * matrix.elementwise_maximum(K, K.T)
elif self.kernel_symm is None:
_logger.debug("Using no symmetrization.")
_logger.log_debug("Using no symmetrization.")
pass
else:
raise NotImplementedError
Expand Down
2 changes: 1 addition & 1 deletion graphtools/estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ def _set_graph_params(self, **params):
)
self.graph.set_params(**params)
except ValueError as e:
_logger.debug("Reset graph due to {}".format(str(e)))
_logger.log_debug("Reset graph due to {}".format(str(e)))
self.graph = None

@abc.abstractmethod
Expand Down
10 changes: 5 additions & 5 deletions graphtools/graphs.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ def build_kernel_to_data(

radius = bandwidth * np.power(-1 * np.log(self.thresh), 1 / self.decay)
update_idx = np.argwhere(np.max(distances, axis=1) < radius).reshape(-1)
_logger.debug(
_logger.log_debug(
"search_knn = {}; {} remaining".format(search_knn, len(update_idx))
)
if len(update_idx) > 0:
Expand Down Expand Up @@ -399,7 +399,7 @@ def build_kernel_to_data(
else radius[i]
)
]
_logger.debug(
_logger.log_debug(
"search_knn = {}; {} remaining".format(
search_knn, len(update_idx)
)
Expand All @@ -412,7 +412,7 @@ def build_kernel_to_data(
).fit(self.data_nu)
if len(update_idx) > 0:
if search_knn == knn_max:
_logger.debug(
_logger.log_debug(
"knn search to knn_max ({}) on {}".format(
knn_max, len(update_idx)
)
Expand All @@ -425,7 +425,7 @@ def build_kernel_to_data(
distances[idx] = dist_new[i]
indices[idx] = ind_new[i]
else:
_logger.debug("radius search on {}".format(len(update_idx)))
_logger.log_debug("radius search on {}".format(len(update_idx)))
# give up - radius search
dist_new, ind_new = knn_tree.radius_neighbors(
Y[update_idx, :],
Expand Down Expand Up @@ -1302,7 +1302,7 @@ def build_kernel(self):

# iterate through sample ids
for i, idx in enumerate(self.samples):
_logger.debug(
_logger.log_debug(
"subgraph {}: sample {}, "
"n = {}, knn = {}".format(
i, idx, np.sum(self.sample_idx == idx), self.knn
Expand Down