-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
62 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# Pycharm | ||
.idea/ | ||
|
||
tut_upcode.md | ||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/usr/bin/env python # | ||
# ------------------------------------------------------------------------------------------------------# | ||
# Created by "Thieu Nguyen" at 02:52, 07/12/2019 # | ||
# # | ||
# Email: [email protected] # | ||
# Homepage: https://www.researchgate.net/profile/Thieu_Nguyen6 # | ||
# Github: https://github.com/thieunguyen5991 # | ||
#-------------------------------------------------------------------------------------------------------# | ||
|
||
|
||
import numpy as np | ||
|
||
class Functions: | ||
""" | ||
This class of functions is belongs to 1-dimensional space | ||
""" | ||
|
||
def _gramacy_lee__(self, solution=None): | ||
""" | ||
Class: uni-modal, non-convex, continuous | ||
Global: 1 global minimum fx = −0.869011134989500, atx 0.548563444114526 | ||
Link: http://benchmarkfcns.xyz/benchmarkfcns/gramacyleefcn.html | ||
@param solution: A numpy array include 1 items like: [0.5], limited range: [-0.5, 2.5] | ||
""" | ||
n = len(solution) | ||
assert (n == 1, 'Gramacy and Lee function is only defined on a 1D space.') | ||
return np.sin(10*np.pi*solution) / (2*solution) + (solution-1)**4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/usr/bin/env python # | ||
# ------------------------------------------------------------------------------------------------------# | ||
# Created by "Thieu Nguyen" at 02:52, 07/12/2019 # | ||
# # | ||
# Email: [email protected] # | ||
# Homepage: https://www.researchgate.net/profile/Thieu_Nguyen6 # | ||
# Github: https://github.com/thieunguyen5991 # | ||
#-------------------------------------------------------------------------------------------------------# | ||
|
||
|
||
import numpy as np | ||
|
||
class Functions: | ||
""" | ||
This class of functions is belongs to 3-dimensional space | ||
""" | ||
|
||
def _wolfe__(self, solution=None): | ||
""" | ||
Class: multi-modal, non-convex, continuous, differentiable, non-separable | ||
Global: 1 global minimum fx = 0, [0, 0, 0] | ||
Link: http://benchmarkfcns.xyz/benchmarkfcns/wolfefcn.html | ||
@param solution: A numpy array include 3 items like: [0.2, 0.22, 0.5], limited range: [0, 2] | ||
""" | ||
n = len(solution) | ||
assert (n == 3, 'Wolfe function is only defined on a 3D space.') | ||
return 4/3 * (solution[0]**2 + solution[1]**2 - solution[0]*solution[1])**0.75 + solution[2] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,12 +7,12 @@ def readme(): | |
|
||
setup( | ||
name="opfunu", | ||
version="0.2.0", | ||
description="A python package for Optimization Functions in Numpy.", | ||
version="0.2.1", | ||
description="A python (Numpy) package for Un-constrained Optimization Functions", | ||
long_description=readme(), | ||
long_description_content_type="text/markdown", | ||
url="https://github.com/thieunguyen5991/opfunu", | ||
download_url="https://github.com/thieunguyen5991/opfunu/archive/v.0.2.0.zip", | ||
download_url="https://github.com/thieunguyen5991/opfunu/archive/v.0.2.1.zip", | ||
author="Thieu Nguyen", | ||
author_email="[email protected]", | ||
license="Apache License, Version 2.0", | ||
|