Ignore:
Timestamp:
08/04/10 16:07:50 (6 years ago)
Author:
altafang
Message:

Fixing minor things, adjusting termination conditions on tests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/alta/mystic-0.2a1/test_constraints_cvxopt_qp_allsolvers.py

    r361 r373  
    232232# Additional parameters 
    233233ndim = 2        # Number of variables in the x vector. 
    234 x0 = [0.5, 0.5]   # Infeasible initial point is ok! 
    235 #x0 = [0.8, 0.3] 
    236 #x0 = [1., 1.] 
     234#x0 = [0.5, 0.5]   # Feasible 
     235#x0 = [0.8, 0.3] # Infeasible 
     236x0 = [1., 1.]  # Infeasible 
    237237npop = 25       # Required for differential evolution solver 
    238238 
     
    589589    from scipy_bfgs import BFGSSolver 
    590590    from mystic.termination import VTR 
     591    from mystic.termination import GradientTermination 
     592    from mystic.termination import ChangeOverGeneration as COG 
    591593    solver = BFGSSolver(ndim) 
    592594       
    593595    solver.SetInitialPoints(x0) 
    594596    solver.enable_signal_handler() 
    595     term = VTR() 
     597    term = VTR() # works well 
     598    #term = GradientTermination() # works well 
     599    #term= COG() # works well 
    596600    solver.Solve(costfunc, term, constraints=constraints_string, \ 
    597601                constraints_method='auglag') 
     
    619623    from scipy_ncg import NCGSolver 
    620624    from mystic.termination import VTR 
     625    from mystic.termination import SolutionImprovement 
     626    from mystic.termination import ChangeOverGeneration as COG 
    621627    solver = NCGSolver(ndim) 
    622628       
    623629    solver.SetInitialPoints(x0) 
    624630    solver.enable_signal_handler() 
    625     term = VTR() 
    626     solver.Solve(costfunc, term, constraints=constraints_string, \ 
    627                 constraints_method='auglag') 
     631    term = VTR() # very slow with [0.8, 0.3] 
     632    #term = SolutionImprovement() # very slow with [0.8, 0.3] 
     633    #term = COG() # very slow with [0.8, 0.3] 
     634    solver.Solve(costfunc, term, constraints=constraints_string, \ 
     635                constraints_method='auglag', disp=True) 
    628636    soln = solver.Solution() 
    629637 
     
    11351143    test_powelldirectional_auglag() 
    11361144    test_bfgs_auglag()  
    1137     test_ncg_auglag() # little off. gets stuck with x0=[0.8, 0.3] 
     1145    test_ncg_auglag() # very slow, esp. in the first SUMT iteration. probably 
     1146                       # relies on the hack to not get completely stuck. 
    11381147    test_cg_auglag()  
    11391148 
Note: See TracChangeset for help on using the changeset viewer.