Skip to content

Commit

Permalink
Fix candidates scaling issue and update IPP example
Browse files Browse the repository at this point in the history
  • Loading branch information
itskalvik committed Aug 22, 2024
1 parent 89888be commit 5b9e8ca
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 103 deletions.
39 changes: 4 additions & 35 deletions benchmarks/plots.ipynb

Large diffs are not rendered by default.

112 changes: 49 additions & 63 deletions examples/IPP.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from setuptools import setup, find_packages

__version__ = "1.0.4"
__version__ = "1.0.5"

setup(
name='sgptools',
Expand Down
2 changes: 1 addition & 1 deletion sgptools/models/core/augmented_gpr.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class AugmentedGPR(GPR):
def __init__(
self,
*args,
transform,
transform=None,
**kwargs
):
super().__init__(
Expand Down
2 changes: 1 addition & 1 deletion sgptools/models/core/augmented_sgpr.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class AugmentedSGPR(SGPR):
def __init__(
self,
*args,
transform,
transform=None,
inducing_variable_time=None,
**kwargs
):
Expand Down
1 change: 1 addition & 0 deletions sgptools/utils/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ def get_dataset(dataset_type, dataset_path=None,
X_train = X_scaler.transform(X_train)*10.0
X_test = X_scaler.transform(X_test)*10.0
X = X_scaler.transform(X)*10.0
candidates = X_scaler.transform(candidates)*10.0

y_scaler = StandardScaler()
y_scaler.fit(y_train)
Expand Down
6 changes: 4 additions & 2 deletions sgptools/utils/tsp.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ def run_tsp(nodes,
depth=1,
resample=None,
start_idx=None,
end_idx=None):
end_idx=None,
time_limit=10):
"""Method to run TSP/VRP with arbitrary start and end nodes,
and without any distance constraint
Expand All @@ -38,6 +39,7 @@ def run_tsp(nodes,
`resample` number of points
start_idx (list): Optionl list of start node indices from which to start the solution path
end_idx (list): Optionl list of end node indices from which to start the solution path
time_limit (int): TSP runtime time limit in seconds
Returns:
paths (ndarray): Solution paths
Expand Down Expand Up @@ -102,7 +104,7 @@ def distance_callback(from_index, to_index):
search_parameters.local_search_metaheuristic = (
routing_enums_pb2.LocalSearchMetaheuristic.GUIDED_LOCAL_SEARCH
)
search_parameters.time_limit.seconds = 10
search_parameters.time_limit.seconds = time_limit
solution = routing.SolveWithParameters(search_parameters)

paths = None
Expand Down

0 comments on commit 5b9e8ca

Please sign in to comment.