Skip to content

Commit

Permalink
change default threads to half the cores
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucas Weber authored and Lucas Weber committed Aug 16, 2024
1 parent ed82cc2 commit a7295c6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions changepoynt/algorithms/esst.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ def __init__(self, window_length: int, n_windows: int = None, lag: int = None, r
:param use_fast_hankel: Whether to deploy the fast hankel matrix product.
:param threads: The number of threads the fast hankel matrix product is allowed to use. Default is the number
of cpu cores your system has available.
:param threads: The number of threads the fast hankel matrix product is allowed to use. Default is the half of
the number of cpu cores your system has available.
"""

# save the specified parameters into instance variables
Expand All @@ -86,7 +86,7 @@ def __init__(self, window_length: int, n_windows: int = None, lag: int = None, r
# https://scikit-learn.org/stable/modules/generated/sklearn.utils.extmath.randomized_svd.html
self.random_rank = min(self.rank + 10, self.window_length, self.n_windows)
if self.threads is None:
self.threads = os.cpu_count()
self.threads = os.cpu_count()//2

# specify the methods and their corresponding functions as lambda functions expecting only the hankel matrix
self.methods = {'rsvd': partial(left_entropy, rank=self.rank, random_rank=self.random_rank,
Expand Down

0 comments on commit a7295c6

Please sign in to comment.