hdim-opt 1.3.0__tar.gz → 1.3.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,19 +1,33 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hdim_opt
3
- Version: 1.3.0
4
- Summary: Optimization toolkit for high-dimensional, non-differentiable problems.
3
+ Version: 1.3.1
4
+ Summary: High-dimensional global optimization and sampling toolkit for complex and non-differentiable problems.
5
5
  Author-email: Julian Soltes <jsoltes@regis.edu>
6
6
  License: MIT
7
+ Project-URL: Homepage, https://github.com/jgsoltes/hdim_opt
7
8
  Project-URL: Repository, https://github.com/jgsoltes/hdim_opt
8
- Keywords: optimization,high-dimensional,sampling,QUASAR,hyperellipsoid
9
+ Project-URL: Issues, https://github.com/jgsoltes/hdim_opt/issues
10
+ Project-URL: Changelog, https://github.com/jgsoltes/hdim_opt/releases
11
+ Keywords: optimization,high-dimensional,sampling,QUASAR,hyperellipsoid,evolutionary-algorithm,non-differentiable,global-optimization,stochastic-optimization,black-box-optimization
12
+ Classifier: Development Status :: 5 - Production/Stable
9
13
  Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.8
15
+ Classifier: Programming Language :: Python :: 3.9
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
10
19
  Classifier: License :: OSI Approved :: MIT License
11
20
  Classifier: Operating System :: OS Independent
12
21
  Classifier: Intended Audience :: Science/Research
13
22
  Classifier: Intended Audience :: Developers
23
+ Classifier: Intended Audience :: Education
24
+ Classifier: Natural Language :: English
14
25
  Classifier: Topic :: Scientific/Engineering :: Mathematics
15
26
  Classifier: Topic :: Scientific/Engineering :: Physics
16
27
  Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
28
+ Classifier: Topic :: Scientific/Engineering :: Information Analysis
29
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
30
+ Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
17
31
  Requires-Python: >=3.8
18
32
  Description-Content-Type: text/markdown
19
33
  Requires-Dist: numpy
@@ -32,7 +46,7 @@ A modern optimization package to accelerate convergence in complex, high-dimensi
32
46
 
33
47
  All core functions, listed below, are single-line executable and require three essential parameters: [obj_function, bounds, n_samples].
34
48
  * **quasar**: QUASAR optimization for high-dimensional, non-differentiable problems.
35
- * **hds**: Generate an exploitative HDS sequence, to distribute samples in focused regions.
49
+ * **hyperellipsoid**: Generate a non-uniform Hyperellipsoid Density sequence, to focus sample distributions.
36
50
  * **sobol**: Generate a uniform Sobol sequence (via SciPy).
37
51
  * **sensitivity**: Perform Sobol sensitivity analysis to measure each variable's importance on objective function results (via SALib).
38
52
  * **waveform**: Decompose the input waveform array (handles time- and frequency-domain via FFT / IFFT) into a diagnostic summary.
@@ -63,7 +77,7 @@ time, pulse = h.waveform_analysis.e1_waveform()
63
77
  solution, fitness = h.quasar(obj_func, bounds)
64
78
  sens_matrix = h.sensitivity(obj_func, bounds)
65
79
 
66
- hds_samples = h.hds(n_samples, bounds)
80
+ hds_samples = h.hyperellipsoid(n_samples, bounds)
67
81
  sobol_samples = h.sobol(n_samples, bounds)
68
82
  isotropic_samples = h.isotropize(sobol_samples)
69
83
 
@@ -75,7 +89,7 @@ signal_data = h.waveform(x=time,y=pulse)
75
89
 
76
90
  * Benefit: Significant improvements in convergence speed and solution quality compared to contemporary optimizers. (Reference: [https://arxiv.org/abs/2511.13843]).
77
91
 
78
- ## HDS Sampler (Hyperellipsoid Density Sampling)
79
- **HDS** is a non-uniform Quasi-Monte Carlo sampling method, specifically designed to exploit promising regions of the search space.
92
+ ## HDS Sampler
93
+ **HDS** (Hyperellipsoid Density Sampling) is a non-uniform Quasi-Monte Carlo sampling method, specifically designed to exploit promising regions of the search space.
80
94
 
81
95
  * Benefit: Provides control over the sample distribution. Results in higher average optimization solution quality when used for population initialization compared to uniform QMC methods. (Reference: [https://arxiv.org/abs/2511.07836]).
@@ -4,7 +4,7 @@ A modern optimization package to accelerate convergence in complex, high-dimensi
4
4
 
5
5
  All core functions, listed below, are single-line executable and require three essential parameters: [obj_function, bounds, n_samples].
6
6
  * **quasar**: QUASAR optimization for high-dimensional, non-differentiable problems.
7
- * **hds**: Generate an exploitative HDS sequence, to distribute samples in focused regions.
7
+ * **hyperellipsoid**: Generate a non-uniform Hyperellipsoid Density sequence, to focus sample distributions.
8
8
  * **sobol**: Generate a uniform Sobol sequence (via SciPy).
9
9
  * **sensitivity**: Perform Sobol sensitivity analysis to measure each variable's importance on objective function results (via SALib).
10
10
  * **waveform**: Decompose the input waveform array (handles time- and frequency-domain via FFT / IFFT) into a diagnostic summary.
@@ -35,7 +35,7 @@ time, pulse = h.waveform_analysis.e1_waveform()
35
35
  solution, fitness = h.quasar(obj_func, bounds)
36
36
  sens_matrix = h.sensitivity(obj_func, bounds)
37
37
 
38
- hds_samples = h.hds(n_samples, bounds)
38
+ hds_samples = h.hyperellipsoid(n_samples, bounds)
39
39
  sobol_samples = h.sobol(n_samples, bounds)
40
40
  isotropic_samples = h.isotropize(sobol_samples)
41
41
 
@@ -47,7 +47,7 @@ signal_data = h.waveform(x=time,y=pulse)
47
47
 
48
48
  * Benefit: Significant improvements in convergence speed and solution quality compared to contemporary optimizers. (Reference: [https://arxiv.org/abs/2511.13843]).
49
49
 
50
- ## HDS Sampler (Hyperellipsoid Density Sampling)
51
- **HDS** is a non-uniform Quasi-Monte Carlo sampling method, specifically designed to exploit promising regions of the search space.
50
+ ## HDS Sampler
51
+ **HDS** (Hyperellipsoid Density Sampling) is a non-uniform Quasi-Monte Carlo sampling method, specifically designed to exploit promising regions of the search space.
52
52
 
53
53
  * Benefit: Provides control over the sample distribution. Results in higher average optimization solution quality when used for population initialization compared to uniform QMC methods. (Reference: [https://arxiv.org/abs/2511.07836]).
@@ -4,10 +4,11 @@
4
4
 
5
5
  Functions:
6
6
  - quasar: QUASAR optimization for high-dimensional, non-differentiable problems.
7
- - hds: Generate an exploitative HDS sequence, to distribute samples in focused regions.
7
+ - hyperellipsoid: Generate a non-uniform hyperellipsoid density sequence.
8
8
  - sobol: Generate a uniform Sobol sequence (via SciPy).
9
9
  - sensitivity: Perform Sobol sensitivity analysis to measure each variable's importance on objective function results (via SALib).
10
- - waveform: Decompose the input waveform array (handles time- and frequency-domain via FFT / IFFT) into a diagnostic summary.
10
+ - waveform: Decompose the input waveform array (handles time- and frequency-domain via FFT / IFFT) into a diagnostic summary (work in progress).
11
+ - isotropize: Isotropize the input matrix using zero-phase component analysis.
11
12
 
12
13
  Modules:
13
14
  - test_functions: Contains test functions for local optimization testing.
@@ -29,7 +30,7 @@ Example Usage:
29
30
  >>> solution, fitness = h.quasar(obj_func, bounds)
30
31
  >>> sens_matrix = h.sensitivity(obj_func, bounds)
31
32
 
32
- >>> hds_samples = h.hds(n_samples, bounds)
33
+ >>> hds_samples = h.hyperellipsoid(n_samples, bounds)
33
34
  >>> sobol_samples = h.sobol(n_samples, bounds)
34
35
  >>> isotropic_samples = h.isotropize(sobol_samples)
35
36
 
@@ -37,12 +38,12 @@ Example Usage:
37
38
  """
38
39
 
39
40
  # package version
40
- __version__ = "1.3.0"
41
- __all__ = ['quasar', 'hds', 'sobol', 'sensitivity', 'test_functions', 'quasar_helpers'] # available for star imports
41
+ __version__ = "1.3.1"
42
+ __all__ = ['quasar', 'hyperellipsoid', 'sobol', 'sensitivity', 'test_functions', 'quasar_helpers','waveform'] # available for star imports
42
43
 
43
44
  # import core components
44
45
  from .quasar_optimization import optimize as quasar
45
- from .hyperellipsoid_sampling import sample as hds
46
+ from .hyperellipsoid_sampling import sample as hyperellipsoid
46
47
  from .sobol_sampling import sobol_sample as sobol
47
48
  from .sobol_sensitivity import sens_analysis as sensitivity
48
49
  from .waveform_analysis import analyze_waveform as waveform
@@ -1,5 +1,5 @@
1
1
  # global epslion
2
- epsilon = 1e-12
2
+ epsilon = 1e-16
3
3
 
4
4
  ### misc helper functions
5
5
 
@@ -179,6 +179,7 @@ def fit_pca_for_cluster(cluster_samples, current_origin, initial_samples_std, n_
179
179
  def sample(n_samples, bounds,
180
180
  weights=None, normalize=False,
181
181
  n_ellipsoids=None, n_initial_clusters=None, n_initial_qmc=None,
182
+ ellipsoid_scaling_factor=None,
182
183
  seed=None, plot_dendrogram=False, verbose=False):
183
184
  '''
184
185
  Objective:
@@ -367,11 +368,12 @@ def sample(n_samples, bounds,
367
368
  confidence_level = 0.9999 # captures 99.99% of cluster's samples
368
369
 
369
370
  # critical value (the statistical radius squared)
370
- chi2_critical_value = stats.chi2.ppf(confidence_level, df=n_dimensions)
371
- baseline_factor = 0.55 - 0.01*np.log(n_dimensions) # empirically derived to resample out-of-bounds points
372
-
373
- # square root as the scaling factor (Mahalanobis distance)
374
- ellipsoid_scaling_factor = baseline_factor * np.sqrt(chi2_critical_value)
371
+ if ellipsoid_scaling_factor == None:
372
+ chi2_critical_value = stats.chi2.ppf(confidence_level, df=n_dimensions)
373
+ baseline_factor = 0.55 - 0.01*np.log(n_dimensions) # empirically derived to resample out-of-bounds points
374
+
375
+ # square root as the scaling factor (Mahalanobis distance)
376
+ ellipsoid_scaling_factor = baseline_factor * np.sqrt(chi2_critical_value)
375
377
 
376
378
  # QMC sequence for radius scaling
377
379
  radius_qmc_sampler = stats.qmc.Sobol(d=1, seed=seed+1) # offset seed from initial qmc
@@ -2,52 +2,52 @@
2
2
  import pandas as pd
3
3
  from sklearn.preprocessing import StandardScaler
4
4
  import numpy as np
5
- from scipy.linalg import cholesky, solve_triangular
6
- epsilon = 1e-12
5
+ epsilon = 1e-16
7
6
 
8
7
  def isotropize(data):
9
8
  '''
10
9
  Objective:
11
- - Converts data to isotropic space. Removes correlations and scales to mean and variance.
12
- - Promotes optimization stability.
13
- Inputs:
14
- - data: Input data.
15
- Outputs:
16
- - data_isotropic: Isotropized data.
17
- - metadata: Scaler and whitening matrix
10
+ - Converts data to isotropic space using Zero-Phase Component Analysis (ZCA).
11
+ - Maintains original feature orientation while removing correlations.
18
12
  '''
13
+ from scipy.linalg import eigh
19
14
 
20
15
  # convert to array
21
16
  X = np.array(data)
22
17
 
23
18
  # standard scaling (mean = 0, var = 1)
24
19
  mean = np.mean(X, axis=0)
25
- stdev = np.std(X, axis=0)
20
+ stdev = np.std(X, axis=0) + epsilon # Add epsilon to avoid div0
26
21
  X_centered = (X - mean) / stdev
27
22
 
28
- # whitening parameters
29
- n_dims = X_centered.shape[1]
30
- cov = np.cov(X_centered, rowvar=False) + np.eye(n_dims) * epsilon
31
- L = cholesky(cov, lower=True)
23
+ # eigen-decomposition of the correlation matrix
24
+ cov = np.cov(X_centered, rowvar=False) + np.eye(X_centered.shape[1]) * epsilon
25
+ eigenvalues, eigenvectors = eigh(cov) # eigh is more stable for symmetric matrices like covariance
32
26
 
33
- # transform Y = (X_centered) @ (L^-1).T
34
- data_iso = solve_triangular(L, X_centered.T, lower=True).T
27
+ # ZCA whitening matrix: W_zca = U @ diag(1/sqrt(lambda)) @ U.T
28
+ # transforms data to identity covariance while minimizing rotation
29
+ diag_inv_sqrt = np.diag(1.0 / np.sqrt(eigenvalues + epsilon))
30
+ W_zca = eigenvectors @ diag_inv_sqrt @ eigenvectors.T
31
+
32
+ # transform: y = X_centered @ W_zca.T
33
+ data_iso = np.dot(X_centered, W_zca.T)
35
34
 
36
35
  # store parameters for deisotropization
37
36
  params = {
38
37
  'mean': mean,
39
38
  'stdev': stdev,
40
- 'L': L
39
+ 'W_zca': W_zca,
40
+ 'W_zca_inv': eigenvectors @ np.diag(np.sqrt(eigenvalues + epsilon)) @ eigenvectors.T
41
41
  }
42
42
  return data_iso, params
43
43
 
44
44
  def deisotropize(data_iso, params):
45
- '''De-isotropize data to its original parameter space.'''
45
+ '''De-isotropize data to its original parameter space via inverse ZCA.'''
46
46
 
47
- # reverse whitening: X_centered = Y @ L.T
48
- data_centered = np.dot(data_iso, params['L'].T)
47
+ # inverse ZCA: X_centered = y @ W_zca_inv.T
48
+ data_centered = np.dot(data_iso, params['W_zca_inv'].T)
49
49
 
50
- # reverse scaling: X = (X_centered * std) + mean
50
+ # inverse scaling: X = (X_centered * std) + mean
51
51
  data_original = (data_centered * params['stdev']) + params['mean']
52
52
  return data_original
53
53
 
@@ -371,10 +371,10 @@ def asym_reinit(population, current_fitnesses, bounds, reinit_method, seed, vect
371
371
  def optimize(func, bounds, args=(),
372
372
  init='sobol', popsize=None, maxiter=100,
373
373
  entangle_rate=0.33, polish=True, polish_minimizer=None,
374
- patience=np.inf, vectorized=False,
375
- hds_weights=None, kwargs={},
374
+ patience=np.inf, tolerance=-np.inf, vectorized=False,
375
+ kwargs={},
376
376
  constraints=None, constraint_penalty=1e9,
377
- reinitialization_method='covariance',
377
+ reinitialization='covariance', hds_weights=None,
378
378
  verbose=True, plot_solutions=True, num_to_plot=10, plot_contour=True,
379
379
  workers=1, seed=None
380
380
  ):
@@ -382,7 +382,6 @@ def optimize(func, bounds, args=(),
382
382
  Objective:
383
383
  - Finds the optimal solution for a given objective function.
384
384
  - Designed for non-differentiable, high-dimensional problems.
385
- - For explorative problems chance reinitialization_method to '
386
385
  - Test functions available for local testing, called as hdim_opt.test_functions.function_name.
387
386
  - Existing test functions: [rastrigin, ackley, sinusoid, sphere, shubert].
388
387
 
@@ -413,11 +412,10 @@ def optimize(func, bounds, args=(),
413
412
  - Recommended to place constraints in objective function to use Powell.
414
413
 
415
414
  - patience: Number of generations without improvement before early convergence.
415
+ - tolerance: Target objective function value for early convergence.
416
416
  - vectorized: Boolean to accept vectorized (N,D) objective functions
417
- - Extremely efficient, highly recommended whenever possible.
417
+ - Highly efficient, recommended when possible.
418
418
 
419
- - hds_weights: Optional weights for hyperellipsoid density sampling initialization.
420
- - {0 : {'center' : center, 'std': stdev}, 1: {...} }
421
419
  - kwargs: Dictionary of keyword arguments for the objective function.
422
420
 
423
421
  - constraints: Dictionary of constraints to penalize.
@@ -433,11 +431,13 @@ def optimize(func, bounds, args=(),
433
431
  }
434
432
  - constraint_penalty: Penalty applied to each constraint violated, defaults to 1e12.
435
433
 
436
- - reinitialization_method: Type of re-sampling to use in the asymptotic reinitialization.
434
+ - reinitialization: Type of re-sampling to use in the asymptotic reinitialization.
437
435
  - Options are ['covariance', 'sobol'].
438
- - 'covariance' (exploitative) is default for most problems.
436
+ - 'covariance' (exploitative) is default for N > D problems.
439
437
  - 'sobol' (explorative) is optional, for high exploration and faster computation.
440
438
  - None to disable reinitialization calculations.
439
+ - hds_weights: Optional weights for hyperellipsoid density sampling initialization.
440
+ - {0 : {'center' : center, 'std': stdev}, 1: {...} }
441
441
 
442
442
  - verbose: Displays prints and plots.
443
443
  - Mutation factor distribution shown with hdim_opt.test_functions.plot_mutations()
@@ -499,10 +499,7 @@ def optimize(func, bounds, args=(),
499
499
  # ensure bounds is array; shape (n_dimensions,2)
500
500
  bounds = np.array(bounds)
501
501
  n_dimensions = bounds.shape[0]
502
-
503
- if n_dimensions == 1:
504
- reinitialization = False
505
-
502
+
506
503
  # if init is not a string, assume it is a custom population
507
504
  if not isinstance(init, str):
508
505
  popsize = init.shape[0]
@@ -516,7 +513,11 @@ def optimize(func, bounds, args=(),
516
513
  # ensure integers
517
514
  popsize, maxiter = int(popsize), int(maxiter)
518
515
 
516
+ # map to sobol if N < D
517
+ if n_dimensions == 1:
518
+ reinitialization = None
519
519
 
520
+
520
521
  ################################# INPUT ERRORS #################################
521
522
 
522
523
  # entangle rate error
@@ -537,11 +538,11 @@ def optimize(func, bounds, args=(),
537
538
  # generate initial population
538
539
  initial_population = initialize_population(popsize, bounds, init, hds_weights, seed, verbose)
539
540
  if verbose:
540
- if reinitialization_method not in ['sobol', 'covariance', None]:
541
- print("reinitialization_method must be one of ['covariance', 'sobol', None].")
541
+ if reinitialization not in ['sobol', 'covariance', None]:
542
+ print("reinitialization must be one of ['covariance', 'sobol', None].")
542
543
  print(f'\nEvolving (None):')
543
544
  else:
544
- print(f'\nEvolving ({reinitialization_method}):')
545
+ print(f'\nEvolving ({reinitialization}):')
545
546
 
546
547
  # match differential evolution conventions
547
548
  if vectorized:
@@ -648,12 +649,12 @@ def optimize(func, bounds, args=(),
648
649
  # apply asymptotic covariance reinitialization to population
649
650
  final_proba = 0.33
650
651
  decay_generation = 0.33
651
- if reinitialization_method in ['sobol','covariance']:
652
+ if (reinitialization in ['sobol','covariance']):
652
653
  reinit_proba = np.e**((np.log(final_proba)/(decay_generation*maxiter))*generation)
653
654
  else:
654
655
  reinit_proba = 0.0
655
656
  if np.random.rand() < reinit_proba:
656
- population = asym_reinit(population, current_fitnesses, bounds, reinitialization_method, seed, vectorized=vectorized)
657
+ population = asym_reinit(population, current_fitnesses, bounds, reinitialization, seed, vectorized=vectorized)
657
658
 
658
659
  # clip population to bounds
659
660
  if vectorized:
@@ -685,9 +686,12 @@ def optimize(func, bounds, args=(),
685
686
  # patience for early convergence
686
687
  if (generation - last_improvement_gen) > patience:
687
688
  if verbose:
688
- print(f'\nEarly convergence: number of generations without improvement exceeds patience ({patience}).')
689
+ print(f'Early convergence: number of generations without improvement exceeds patience ({patience}).')
690
+ break
691
+ if best_fitness <= tolerance:
692
+ if verbose:
693
+ print(f'Early convergence: f(x) below tolerance ({tolerance:.2e}).')
689
694
  break
690
-
691
695
 
692
696
  ################################# POLISH #################################
693
697
 
@@ -703,7 +707,7 @@ def optimize(func, bounds, args=(),
703
707
  maxiter=maxiter, vectorized=vectorized, constraints=constraints,
704
708
  args=args, kwargs=kwargs,
705
709
  polish_minimizer=polish_minimizer, verbose=verbose
706
- )
710
+ )
707
711
 
708
712
 
709
713
  ################################# VERBOSE #################################
@@ -4,7 +4,7 @@ import numpy as np
4
4
  def sobol_sample(n_samples, bounds, normalize=False, seed=None):
5
5
  '''
6
6
  Objective:
7
- - Generate a uniform scrambled Sobol sample sequence.
7
+ - Generates a uniform scrambled Sobol sample sequence.
8
8
  Inputs:
9
9
  - n_samples: Number of samples to generate.
10
10
  - bounds: Range to sample over.
@@ -1,4 +1,4 @@
1
- def sens_analysis(func, bounds, n_samples=None,
1
+ def sens_analysis(func, bounds, n_samples=2**7,
2
2
  kwargs=None, param_names=None,
3
3
  verbose=True, log_scale=True):
4
4
  '''
@@ -24,9 +24,10 @@ def sens_analysis(func, bounds, n_samples=None,
24
24
  from SALib.analyze import sobol as sobol_analyze
25
25
  import pandas as pd
26
26
  from functools import partial
27
+ import time
27
28
  except ImportError as e:
28
29
  raise ImportError(f'Sensitivity analysis requires dependencies: (SALib, pandas, functools).') from e
29
-
30
+ start_time = time.time()
30
31
 
31
32
  # define input parameters and their ranges
32
33
  bounds = np.array(bounds)
@@ -34,10 +35,6 @@ def sens_analysis(func, bounds, n_samples=None,
34
35
  if param_names == None:
35
36
  param_names = range(0,n_params)
36
37
 
37
- # scale default n_samples by dimension (power of 2)
38
- if n_samples == None:
39
- n_samples = int(2**np.ceil(np.log2(10*n_params)))
40
-
41
38
  # define problem
42
39
  problem = {
43
40
  'num_vars': n_params,
@@ -68,7 +65,10 @@ def sens_analysis(func, bounds, n_samples=None,
68
65
  S2_df = S2_df.fillna(S2_df.T)
69
66
  mask = np.tril(np.ones_like(S2_df, dtype=bool))
70
67
 
68
+ end_time = time.time()
69
+ run_time = end_time - start_time
71
70
  if verbose:
71
+ print(f'\nRun time: {run_time:.2f}s')
72
72
  # import
73
73
  try:
74
74
  import matplotlib.pyplot as plt
@@ -114,6 +114,7 @@ def sens_analysis(func, bounds, n_samples=None,
114
114
 
115
115
  axs[0].set_yticks(index)
116
116
  axs[0].set_yticklabels(names_sorted)
117
+ axs[0].legend()
117
118
 
118
119
  # plot 2: heatmap of second order indices
119
120
  sns.heatmap(data=S2_df, mask=mask, cbar_kws={'label': 'Second-order Index ($S_2$)'},ax=axs[1]) # magma
@@ -440,7 +440,10 @@ def plot_diagnostic_dashboard(temporal, spectral, metrics):
440
440
  im = ax_spec.pcolormesh(t_spec*1e6, f, 10*np.log10(Sxx + epsilon),
441
441
  shading='gouraud', cmap='plasma')
442
442
 
443
+ ax_spec.set_title('Spectrogram')
443
444
  ax_spec.set_yscale('log')
444
445
  ax_spec.set_ylim(np.abs(spectral['freq']).min()+epsilon, np.abs(spectral['freq'].max()/sample_rate))
446
+ cbar = fig.colorbar(im, ax=ax_spec)
447
+ cbar.set_label('Power/Frequency (dB/Hz)')
445
448
 
446
449
  plt.show()
@@ -1,19 +1,33 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hdim_opt
3
- Version: 1.3.0
4
- Summary: Optimization toolkit for high-dimensional, non-differentiable problems.
3
+ Version: 1.3.1
4
+ Summary: High-dimensional global optimization and sampling toolkit for complex and non-differentiable problems.
5
5
  Author-email: Julian Soltes <jsoltes@regis.edu>
6
6
  License: MIT
7
+ Project-URL: Homepage, https://github.com/jgsoltes/hdim_opt
7
8
  Project-URL: Repository, https://github.com/jgsoltes/hdim_opt
8
- Keywords: optimization,high-dimensional,sampling,QUASAR,hyperellipsoid
9
+ Project-URL: Issues, https://github.com/jgsoltes/hdim_opt/issues
10
+ Project-URL: Changelog, https://github.com/jgsoltes/hdim_opt/releases
11
+ Keywords: optimization,high-dimensional,sampling,QUASAR,hyperellipsoid,evolutionary-algorithm,non-differentiable,global-optimization,stochastic-optimization,black-box-optimization
12
+ Classifier: Development Status :: 5 - Production/Stable
9
13
  Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.8
15
+ Classifier: Programming Language :: Python :: 3.9
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
10
19
  Classifier: License :: OSI Approved :: MIT License
11
20
  Classifier: Operating System :: OS Independent
12
21
  Classifier: Intended Audience :: Science/Research
13
22
  Classifier: Intended Audience :: Developers
23
+ Classifier: Intended Audience :: Education
24
+ Classifier: Natural Language :: English
14
25
  Classifier: Topic :: Scientific/Engineering :: Mathematics
15
26
  Classifier: Topic :: Scientific/Engineering :: Physics
16
27
  Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
28
+ Classifier: Topic :: Scientific/Engineering :: Information Analysis
29
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
30
+ Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
17
31
  Requires-Python: >=3.8
18
32
  Description-Content-Type: text/markdown
19
33
  Requires-Dist: numpy
@@ -32,7 +46,7 @@ A modern optimization package to accelerate convergence in complex, high-dimensi
32
46
 
33
47
  All core functions, listed below, are single-line executable and require three essential parameters: [obj_function, bounds, n_samples].
34
48
  * **quasar**: QUASAR optimization for high-dimensional, non-differentiable problems.
35
- * **hds**: Generate an exploitative HDS sequence, to distribute samples in focused regions.
49
+ * **hyperellipsoid**: Generate a non-uniform Hyperellipsoid Density sequence, to focus sample distributions.
36
50
  * **sobol**: Generate a uniform Sobol sequence (via SciPy).
37
51
  * **sensitivity**: Perform Sobol sensitivity analysis to measure each variable's importance on objective function results (via SALib).
38
52
  * **waveform**: Decompose the input waveform array (handles time- and frequency-domain via FFT / IFFT) into a diagnostic summary.
@@ -63,7 +77,7 @@ time, pulse = h.waveform_analysis.e1_waveform()
63
77
  solution, fitness = h.quasar(obj_func, bounds)
64
78
  sens_matrix = h.sensitivity(obj_func, bounds)
65
79
 
66
- hds_samples = h.hds(n_samples, bounds)
80
+ hds_samples = h.hyperellipsoid(n_samples, bounds)
67
81
  sobol_samples = h.sobol(n_samples, bounds)
68
82
  isotropic_samples = h.isotropize(sobol_samples)
69
83
 
@@ -75,7 +89,7 @@ signal_data = h.waveform(x=time,y=pulse)
75
89
 
76
90
  * Benefit: Significant improvements in convergence speed and solution quality compared to contemporary optimizers. (Reference: [https://arxiv.org/abs/2511.13843]).
77
91
 
78
- ## HDS Sampler (Hyperellipsoid Density Sampling)
79
- **HDS** is a non-uniform Quasi-Monte Carlo sampling method, specifically designed to exploit promising regions of the search space.
92
+ ## HDS Sampler
93
+ **HDS** (Hyperellipsoid Density Sampling) is a non-uniform Quasi-Monte Carlo sampling method, specifically designed to exploit promising regions of the search space.
80
94
 
81
95
  * Benefit: Provides control over the sample distribution. Results in higher average optimization solution quality when used for population initialization compared to uniform QMC methods. (Reference: [https://arxiv.org/abs/2511.07836]).
@@ -0,0 +1,76 @@
1
+ # pyproject.toml
2
+
3
+ [build-system]
4
+ requires = ["setuptools>=61.0.0", "wheel"]
5
+ build-backend = "setuptools.build_meta"
6
+
7
+ [project]
8
+ name = "hdim_opt"
9
+ version = "1.3.1" # match __version__ in __init__.py
10
+ description = "High-dimensional global optimization and sampling toolkit for complex and non-differentiable problems."
11
+ readme = {file = "README.md", content-type = "text/markdown"}
12
+
13
+ authors = [
14
+ {name="Julian Soltes", email="jsoltes@regis.edu"}
15
+ ]
16
+
17
+ license = { text = "MIT" }
18
+ requires-python = ">=3.8"
19
+ keywords = [
20
+ "optimization",
21
+ "high-dimensional",
22
+ "sampling",
23
+ "QUASAR",
24
+ "hyperellipsoid",
25
+ "evolutionary-algorithm",
26
+ "non-differentiable",
27
+ "global-optimization",
28
+ "stochastic-optimization",
29
+ "black-box-optimization"
30
+ ]
31
+ classifiers = [
32
+ "Development Status :: 5 - Production/Stable",
33
+ "Programming Language :: Python :: 3",
34
+ "Programming Language :: Python :: 3.8",
35
+ "Programming Language :: Python :: 3.9",
36
+ "Programming Language :: Python :: 3.10",
37
+ "Programming Language :: Python :: 3.11",
38
+ "Programming Language :: Python :: 3.12",
39
+ "License :: OSI Approved :: MIT License",
40
+ "Operating System :: OS Independent",
41
+ "Intended Audience :: Science/Research",
42
+ "Intended Audience :: Developers",
43
+ "Intended Audience :: Education",
44
+ "Natural Language :: English",
45
+ "Topic :: Scientific/Engineering :: Mathematics",
46
+ "Topic :: Scientific/Engineering :: Physics",
47
+ "Topic :: Scientific/Engineering :: Artificial Intelligence",
48
+ "Topic :: Scientific/Engineering :: Information Analysis",
49
+ "Topic :: Software Development :: Libraries :: Python Modules",
50
+ "Topic :: Scientific/Engineering :: Bio-Informatics"
51
+ ]
52
+ dependencies = ["numpy", "scipy"]
53
+
54
+ [project.optional-dependencies]
55
+ hds = [
56
+ # required by HDS `pip install hdim_opt[hds]`
57
+ "pandas",
58
+ "scikit-learn",
59
+ "joblib"
60
+ ]
61
+
62
+ sensitivity = [
63
+ # required by sensitivity `pip install hdim_opt[sensitivity]`
64
+ "pandas",
65
+ "SALib"
66
+ ]
67
+
68
+ [project.urls]
69
+ Homepage = "https://github.com/jgsoltes/hdim_opt"
70
+ Repository = "https://github.com/jgsoltes/hdim_opt"
71
+ Issues = "https://github.com/jgsoltes/hdim_opt/issues"
72
+ Changelog = "https://github.com/jgsoltes/hdim_opt/releases"
73
+
74
+ [tool.setuptools.packages.find]
75
+ where = ["."]
76
+ include = ["hdim_opt*"] # find hdim_opt package
@@ -1,51 +0,0 @@
1
- # pyproject.toml
2
-
3
- [build-system]
4
- requires = ["setuptools>=61.0.0", "wheel"]
5
- build-backend = "setuptools.build_meta"
6
-
7
- [project]
8
- name = "hdim_opt"
9
- version = "1.3.0" # match __version__ in __init__.py
10
- description = "Optimization toolkit for high-dimensional, non-differentiable problems."
11
- readme = {file = "README.md", content-type = "text/markdown"}
12
-
13
- authors = [
14
- {name="Julian Soltes", email="jsoltes@regis.edu"}
15
- ]
16
-
17
- license = { text = "MIT" }
18
- requires-python = ">=3.8"
19
- keywords = ["optimization", "high-dimensional", "sampling", "QUASAR", "hyperellipsoid"]
20
- classifiers = [
21
- "Programming Language :: Python :: 3",
22
- "License :: OSI Approved :: MIT License",
23
- "Operating System :: OS Independent",
24
- "Intended Audience :: Science/Research",
25
- "Intended Audience :: Developers",
26
- "Topic :: Scientific/Engineering :: Mathematics",
27
- "Topic :: Scientific/Engineering :: Physics",
28
- "Topic :: Scientific/Engineering :: Artificial Intelligence"
29
- ]
30
- dependencies = ["numpy", "scipy"]
31
-
32
- [project.optional-dependencies]
33
- hds = [
34
- # required by HDS `pip install hdim_opt[hds]`
35
- "pandas",
36
- "scikit-learn",
37
- "joblib"
38
- ]
39
-
40
- sensitivity = [
41
- # required by sensitivity `pip install hdim_opt[sensitivity]`
42
- "pandas",
43
- "SALib"
44
- ]
45
-
46
- [project.urls]
47
- Repository = "https://github.com/jgsoltes/hdim_opt"
48
-
49
- [tool.setuptools.packages.find]
50
- where = ["."]
51
- include = ["hdim_opt*"] # find hdim_opt package
File without changes