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-1.9.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-1.9-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: gobc_pa-1.9.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-1.9.tar.gz
Algorithm Hash digest
SHA256 dd087e218f93de8c07961718795a01b4c99513adb0af2a04c07b1b0615ef0aec
MD5 7d7724eccaf04418575cbc1fbe9be541
BLAKE2b-256 0ed0a29552bc916ea1521422cc9ec315330b503f661799c716872853c5b8e506

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gobc_pa-1.9-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-1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 6d34a2957589013d2d29a785ab3ac3ab48b3df644912531c9f885b938bd3baab
MD5 7f29ed159f23f2d1d32c8320601c83d0
BLAKE2b-256 20e5325e253d6c6c77b1e033a1ac63bb6a6eaad52280d81a8907c85eb0e06f2c

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