Skip to content

Commit

Permalink
Merge pull request #194 from hrntsm/develop
Browse files Browse the repository at this point in the history
Update v0.8.2
  • Loading branch information
hrntsm authored Sep 4, 2023
2 parents e53780b + c1ad9a9 commit d101e78
Show file tree
Hide file tree
Showing 9 changed files with 72 additions and 57 deletions.
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"dotnet.defaultSolution": "Tunny.sln"
}
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,20 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p

Please see [here](https://github.com/hrntsm/Tunny/releases) for the data released for each version.

## [v0.8.2] -2023-09-04

### Changed

- Stopped putting built files together in gha.
- Because some people did not work in some environments
- If the objective function contains null for 10 consecutive times, optimization is stopped.
- Update python lib
- bump up optuna v3.3 & optuna-dashboard v0.12.0 & some library

### Fixed

- NSGA-III supports constraints, but was getting a message that constraints are not taken into account

## [v0.8.1] -2023-07-30

### Added
Expand Down
35 changes: 17 additions & 18 deletions PYTHON_PACKAGE_LICENSES
Original file line number Diff line number Diff line change
Expand Up @@ -10,39 +10,38 @@ summary
| Name | Version | License |
|-------------------|---------|---------------------------------------------------|
| Mako | 1.2.4 | MIT License |
| MarkupSafe | 2.1.2 | BSD License |
| MarkupSafe | 2.1.3 | BSD License |
| PyYAML | 6.0 | MIT License |
| SQLAlchemy | 1.4.46 | MIT License |
| alembic | 1.9.2 | MIT License |
| SQLAlchemy | 2.0.20 | MIT License |
| alembic | 1.12.0 | MIT License |
| botorch | 0.7.3 | MIT License |
| bottle | 0.12.23 | MIT License |
| cmaes | 0.9.1 | MIT License |
| bottle | 0.12.25 | MIT License |
| cmaes | 0.10.0 | MIT License |
| colorama | 0.4.6 | BSD License |
| colorlog | 6.7.0 | MIT License |
| gpytorch | 1.9.0 | MIT |
| greenlet | 2.0.1 | MIT License |
| joblib | 1.2.0 | BSD License |
| greenlet | 2.0.2 | MIT License |
| joblib | 1.3.2 | BSD License |
| linear-operator | 0.2.0 | MIT |
| multipledispatch | 0.6.0 | BSD |
| numpy | 1.24.1 | BSD License |
| numpy | 1.25.2 | BSD License |
| opt-einsum | 3.3.0 | MIT |
| optuna | 3.2.0 | MIT License |
| optuna-dashboard | 0.10.2 | MIT License |
| packaging | 23.0 | Apache Software License; BSD License |
| optuna | 3.3.0 | MIT License |
| optuna-dashboard | 0.12.0 | MIT License |
| packaging | 23.1 | Apache Software License; BSD License |
| pip | 23.0 | MIT License |
| pip-licenses | 4.0.3 | MIT License |
| plotly | 5.9.0 | MIT |
| prettytable | 3.6.0 | BSD License |
| plotly | 5.16.1 | MIT |
| pyro-api | 0.1.2 | Apache Software License |
| pyro-ppl | 1.8.4 | Apache Software License |
| scikit-learn | 1.2.0 | BSD License |
| scipy | 1.10.0 | BSD License |
| scikit-learn | 1.3.0 | BSD License |
| scipy | 1.11.2 | BSD License |
| setuptools | 65.5.0 | MIT License |
| six | 1.16.0 | MIT License |
| tenacity | 8.1.0 | Apache Software License |
| threadpoolctl | 3.1.0 | BSD License |
| tenacity | 8.2.3 | Apache Software License |
| threadpoolctl | 3.2.0 | BSD License |
| torch | 1.13.1 | BSD License |
| tqdm | 4.64.1 | MIT License; Mozilla Public License 2.0 (MPL 2.0) |
| tqdm | 4.66.1 | MIT License; Mozilla Public License 2.0 (MPL 2.0) |
| typing_extensions | 4.4.0 | Python Software Foundation License |
| wcwidth | 0.2.6 | MIT License |

Expand Down
7 changes: 0 additions & 7 deletions Tunny/FodyWeavers.xml

This file was deleted.

38 changes: 19 additions & 19 deletions Tunny/Lib/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
alembic==1.9.2
alembic==1.12.0
botorch==0.7.3
bottle==0.12.23
cmaes==0.9.1
bottle==0.12.25
cmaes==0.10.0
colorama==0.4.6
colorlog==6.7.0
gpytorch==1.9.0
greenlet==2.0.1
joblib==1.2.0
greenlet==2.0.2
joblib==1.3.2
linear-operator==0.2.0
Mako==1.2.4
MarkupSafe==2.1.2
MarkupSafe==2.1.3
multipledispatch==0.6.0
numpy==1.24.1
numpy==1.25.2
opt-einsum==3.3.0
optuna==3.2.0
optuna-dashboard==0.10.2
packaging==23.0
plotly==5.9.0
optuna==3.3.0
optuna-dashboard==0.12.0
packaging==23.1
plotly==5.16.1
pyro-api==0.1.2
pyro-ppl==1.8.4
PyYAML==6.0
scikit-learn==1.2.0
scipy==1.10.0
PyYAML==6.0.1
scikit-learn==1.3.0
scipy==1.11.2
six==1.16.0
SQLAlchemy==1.4.46
tenacity==8.1.0
threadpoolctl==3.1.0
SQLAlchemy==2.0.20
tenacity==8.2.3
threadpoolctl==3.2.0
torch==1.13.1
tqdm==4.64.1
typing_extensions==4.4.0
tqdm==4.66.1
typing_extensions==4.7.1
22 changes: 16 additions & 6 deletions Tunny/Solver/Algorithm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Linq;
using System.Reflection;
using System.Text;
using System.Windows.Forms;

using Python.Runtime;

Expand Down Expand Up @@ -202,7 +203,7 @@ private void RunOptimize(RunOptimizeSettings optSet, out double[] xTest, out Eva

while (true)
{
if (CheckOptimizeComplete(optSet.NTrials, optSet.Timeout, trialNum, startTime))
if (result == null || CheckOptimizeComplete(optSet.NTrials, optSet.Timeout, trialNum, startTime))
{
break;
}
Expand All @@ -223,7 +224,7 @@ private void RunHumanInTheLoopOptimize(RunOptimizeSettings optSet, int nBatch, o

while (true)
{
if (CheckOptimizeComplete(optSet.NTrials, optSet.Timeout, trialNum, startTime))
if (result == null || CheckOptimizeComplete(optSet.NTrials, optSet.Timeout, trialNum, startTime))
{
break;
}
Expand All @@ -244,9 +245,8 @@ private EvaluatedGHResult RunSingleOptimizeStep(RunOptimizeSettings optSet, doub
dynamic trial = optSet.Study.ask();
var result = new EvaluatedGHResult();

//TODO: Is this the correct way to handle the case of null?
int nullCount = 0;
while (nullCount < 10)
while (true)
{
for (int j = 0; j < Variables.Count; j++)
{
Expand All @@ -259,7 +259,17 @@ private EvaluatedGHResult RunSingleOptimizeStep(RunOptimizeSettings optSet, doub
result = EvalFunc(pState, progress);
optSet.HumanInTheLoop?.SaveNote(optSet.Study, trial, result.ObjectiveImages);

if (result.ObjectiveValues.Contains(double.NaN))
if (nullCount >= 10)
{
TunnyMessageBox.Show(
"The objective function returned NaN 10 times in a row. Tunny terminates the optimization. Please check the objective function.",
"Tunny",
MessageBoxButtons.OK,
MessageBoxIcon.Error
);
return null;
}
else if (result.ObjectiveValues.Contains(double.NaN))
{
trial = optSet.Study.ask();
nullCount++;
Expand Down Expand Up @@ -483,7 +493,7 @@ private dynamic SetSamplerSettings(int samplerType, dynamic optuna, bool hasCons
default:
throw new ArgumentException("Unknown sampler type");
}
if (samplerType > 3 && hasConstraints)
if (samplerType > 4 && hasConstraints)
{
TunnyMessageBox.Show("Only TPE, GP and NSGA support constraints. Optimization is run without considering constraints.", "Tunny");
}
Expand Down
6 changes: 1 addition & 5 deletions Tunny/Tunny.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFramework>net48</TargetFramework>
<Version>0.8.1</Version>
<Version>0.8.2</Version>
<Title>Tunny</Title>
<Description>Tunny is an optimization component wrapped in optuna.</Description>
<TargetExt>.gha</TargetExt>
Expand Down Expand Up @@ -30,10 +30,6 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Costura.Fody" Version="5.7.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Grasshopper" Version="7.13.21348.13001" IncludeAssets="compile;build" />
<PackageReference Include="Microsoft.Data.Sqlite.Core" Version="7.0.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
Expand Down
2 changes: 1 addition & 1 deletion Tunny/TunnyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Tunny
public class Tunny : GH_AssemblyInfo
{
public override string Name => "Tunny";
public override string Version => "0.8.1";
public override string Version => "0.8.2";
public override Bitmap Icon => Resource.TunnyIcon;
public override string Description => "Tunny is an optimization component wrapped in optuna.";
public override Guid Id => new Guid("01E58960-AFAA-48FF-BC90-174FDC4A9D64");
Expand Down
2 changes: 1 addition & 1 deletion Yak/manifest.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Tunny
version: 0.8.1
version: 0.8.2
authors:
- hrntsm
description: 🐟Tunny🐟 is Grasshopper's optimization component using Optuna, an open source hyperparameter auto-optimization framework. Tunny includes some features such as multi-objective optimization with constraint, Quasi-MonteCarlo sampling and dashboards for results analysis etc.
Expand Down

0 comments on commit d101e78

Please sign in to comment.