Skip to main content

A new unconstrained global optimization method based on clustering and parabolic approximation

Project description

Table of contents

Updates

  • GPU support has been added.

The updated methodology is a GPU-accelerated, tensor-based reformulation of the Global Optimization based on Clustering and Parabolic Approximation (GOBC-PA) algorithm, developed in TensorFlow to enable end-to-end parallel execution across high-dimensional optimization landscapes.

General Info

GOBC-PA: A new unconstrained global optimization method based on clustering and parabolic approximation (GOBC-PA) is proposed. Although the proposed method is basically similar to other evolutionary and stochastic methods, it represents a significant advancement of global optimization technology for four important reasons. First, it is orders of magnitude faster than existing optimization methods for global optimization of unconstrained problems. Second, it has significantly better repeatability, numerical stability, and robustness than current methods in dealing with high dimensionally and many local minima functions. Third, it can easily and faster find the local minimums using the parabolic approximation instead of gradient descent or crossover operations. Fourth, it can easily adapted to any theoretical or industrial systems which are using the heuristic methods as an intelligent system. In this study, we assume that the best cluster center gives the position of the possible global optimum. The usage of clustering and curve fitting techniques brings multi-start and local search properties to the proposed method. The experimental studies show that the proposed methodology is simple, faster and, it demonstrates a superior performance when compared with some state of the art methods.

Args:

  • func - Objective function. If device='gpu' or 'mps', this must be a batched TF function. If device='cpu', it should be a standard Python function taking a 1D NumPy array.
  • dim - Dimensionality of the problem.
  • pop_size - Population size.
  • max_iter - Maximum number of iterations.
  • bounds - A tuple (min, max) or a list of tuples for each dimension.
  • device - 'cpu', 'gpu', or 'mps'. Default is 'cpu'
  • seed - Random seed (GPU only).

Returns:

  • best_pos - Global minimum point
  • best_score - Global minimum value on global minimum point
  • additional_metrics_dict - best points and their objective value on each epoch

Technologies

Project is created with:

  • Python 3.11

Setup

To run this project, install it locally using pip:

$ pip install GOBC-PA

How to use

from GOBC_PA.GOBC_PA import GOBC_PA
Best_point, Best_result, performance = GOBC_PA(func,dim,pop_size,max_iter,bounds,device)
 

Example (CPU)

import numpy as np
from GOBC_PA.GOBC_PA import GOBC_PA

def func(x):  # Rastrigin function
    y= x[0]**2+x[1]**2-np.cos(18*x[0])-np.cos(18*x[1])
    return y

dim,pop_size,max_iter = 2,60,1000
bounds = (-1,1)
Best_point, Best_result, performance = GOBC_PA(func,dim,pop_size,max_iter,bounds)
 

Example 2 (CPU)

import numpy as np
from GOBC_PA.GOBC_PA import GOBC_PA

def func2(x):  # Goldstein-Price's Function
    y = (1 + ((x[0] + x[1] + 1) ** 2) * (
                19 - 14 * x[0] + 3 * x[0] ** 2 - 14 * x[1] + 6 * x[0] * x[1] + 3 * x[1] ** 2)) * (
                    30 + ((2 * x[0] - 3 * x[1]) ** 2) * (
                        18 - 32 * x[0] + 12 * x[0] ** 2 + 48 * x[1] - 36 * x[0] * x[1] + 27 * x[1] ** 2))
    return y

dim,pop_size,max_iter = 2,60,1000
bounds = (-2,2)
Best_point, Best_result, performance = GOBC_PA(func2,dim,pop_size,max_iter,bounds,device='cpu')
 

Example 3 (GPU)

import tensorflow as tf
import numpy as np
from GOBC_PA.GOBC_PA import GOBC_PA

# Styblinski-Tang Function
@tf.function
def styblinski_tang_tf(pop):
    term = tf.pow(pop, 4) - 16.0 * tf.square(pop) + 5.0 * pop
    return 0.5 * tf.reduce_sum(term, axis=1)

def styblinski_tang_np(x):
    return 0.5 * np.sum(x ** 4 - 16.0 * x ** 2 + 5.0 * x)

dim,pop_size,max_iter = 100,300,1000
bounds = (-5,5)
Best_point, Best_result, performance = GOBC_PA(styblinski_tang_tf,dim,pop_size,max_iter,bounds,device='gpu')
Best_point, Best_result, performance = GOBC_PA(styblinski_tang_np,dim,pop_size,max_iter,bounds,device='cpu')
 

Cite

Pence, I., Cesmeli, M. S., Senel, F. A., & Cetisli, B. (2016). A new unconstrained global optimization method based on clustering and parabolic approximation. Expert Systems with Applications, 55, 493-507.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gobc_pa-2.0.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gobc_pa-2.0-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file gobc_pa-2.0.tar.gz.

File metadata

  • Download URL: gobc_pa-2.0.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for gobc_pa-2.0.tar.gz
Algorithm Hash digest
SHA256 86b540f32a872c7968497a91baa1f1cec37a7045491acf3ec0b15446c5c1fbcc
MD5 65620c295b1dd8149f2c8e58fbfc3967
BLAKE2b-256 4f9fa3566cb0a0f945d19e12998f2365e6cfdf477adbc2b40e85098fd067d59f

See more details on using hashes here.

File details

Details for the file gobc_pa-2.0-py3-none-any.whl.

File metadata

  • Download URL: gobc_pa-2.0-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for gobc_pa-2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6cf3994d287ddce1f6c37a41932be5eba7aba34bb9036343ff404a3ecd21f8d8
MD5 1c8ed0eb28110f3e90b772aa9114d79b
BLAKE2b-256 b45b4a753e67554ec22160fac597d60eefcd713479461143829808499cbecbcd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page