Optimization

Perform Neural Network fitting. Note - Make sure you have the latest scikit_learn. (For conda, simply update anaconda) - This is not for a large model. Find some C++ package for large problem. @author: Geun Ho Gu

Adds optimization functionality to the ORR catalyst structure

class cat_optimize.cat_optimize[source]

Inherits ORR catalyst structure and adds optimization functionality

geo_crossover(x1, x2, pt1=1, pt2=1)[source]

Geometry-based crossover. Partions the catalyst surface into regions in a checkerboard style and performs crossover.

Parameters:
  • x1 – Mom
  • x2 – Dad
  • pt1 – By default, use 1-point crossover in first dimension
  • pt2 – By default, use 1-point crossover in second dimension
Returns:

Two offspring

get_OF()[source]
Parameters:weights – Weights for the objective functions
Returns:A single objective function that is a linear superposition of the other objectives
get_OFs()[source]

Evaluate the objective functions :returns: 2-ple of surface energy and current density

plotpop.plot_pop_MO(data, fname=None, title=None)[source]

Plot the population fitnesses for a multiple objective genetic algorithm

Parameters:
  • data – 2-column matrix with objective values for each individual in each row
  • fname – File name to save the graph as. If none is given, it just displays.
  • title – Title for the graph.
plotpop.plot_pop_SO(data, fname=None, title=None)[source]

Plot the population fitnesses for a single objective genetic algorithm

Parameters:
  • data – List or 1-D array of values
  • fname – File name to save the graph as. If none is given, it just displays.
  • title – Title for the graph.

General implementation of multi-objective simulated annealing See June 22 “Implemented optimization” commit

sim_anneal.optimize(eval_obj, total_steps=1000, initial_T=0.7, n_record=100)[source]

Use simulated annealing to optimize defects on the surface

Parameters:
  • eval_obj – Object to be optimized. Must have get_OF(), rand_move(), and revert_last() methods.
  • total_steps – Number of Metropolis steps to run
  • initial_T – Initial temperature (dimensionless). A linear cooling schedule is used
  • n_record – number of steps to print out (not counting initial state)