-
Notifications
You must be signed in to change notification settings - Fork 378
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #185 from suavecode/feature-optimizers_from_MF
Mulfi-fidelity Optimizers
- Loading branch information
Showing
8 changed files
with
945 additions
and
11 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
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
31 changes: 31 additions & 0 deletions
31
trunk/SUAVE/Optimization/Package_Setups/TRMM/TRMM_setup.py
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,31 @@ | ||
# TRMM_setup.py | ||
# | ||
# Created: Apr 2017, T. MacDonald | ||
# Modified: | ||
|
||
# ---------------------------------------------------------------------- | ||
# Imports | ||
# ---------------------------------------------------------------------- | ||
|
||
# suave imports | ||
import numpy as np | ||
from SUAVE.Optimization import helper_functions as help_fun | ||
from SUAVE.Optimization.Package_Setups.TRMM import Trust_Region_Optimization as tro | ||
from SUAVE.Optimization.Package_Setups.TRMM.Trust_Region import Trust_Region | ||
|
||
# ---------------------------------------------------------------------- | ||
# TRMM_Solve | ||
# ---------------------------------------------------------------------- | ||
|
||
def TRMM_Solve(problem,tr=None,tr_opt=None,print_output=False): | ||
|
||
if tr == None: | ||
tr = Trust_Region() | ||
problem.trust_region = tr | ||
if tr_opt == None: | ||
TRM_opt = tro.Trust_Region_Optimization() | ||
else: | ||
TRM_opt = tr_opt | ||
TRM_opt.optimize(problem,print_output=print_output) | ||
|
||
return |
32 changes: 32 additions & 0 deletions
32
trunk/SUAVE/Optimization/Package_Setups/TRMM/Trust_Region.py
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,32 @@ | ||
# Trust_Region.py | ||
# | ||
# Created: Apr 2017, T. MacDonald | ||
# Modified: Jun 2017, T. MacDonald | ||
|
||
# ---------------------------------------------------------------------- | ||
# Imports | ||
# ---------------------------------------------------------------------- | ||
|
||
import SUAVE | ||
from SUAVE.Core import Data | ||
|
||
# ---------------------------------------------------------------------- | ||
# Trust Region Class | ||
# ---------------------------------------------------------------------- | ||
|
||
class Trust_Region(Data): | ||
|
||
def __defaults__(self): | ||
|
||
self.initial_size = 0.05 | ||
self.size = 0.05 | ||
self.minimum_size = 1e-15 | ||
self.contract_threshold = 0.25 | ||
self.expand_threshold = 0.75 | ||
self.contraction_factor = 0.25 | ||
self.expansion_factor = 1.5 | ||
|
||
|
||
def evaluate_function(self,f,gviol): | ||
phi = f + gviol**2 | ||
return phi |
Oops, something went wrong.