Tutorial on KAVIAR software tool

Download Report

Transcript Tutorial on KAVIAR software tool

A tool to approximate viability kernels, capture
basins and resilience values
Kernel Approximation for VIAbility and
Resilience
• Written in Java programming language
– Regular grid / active learning algorithm
– Capture basins and resilience values are computed
in dim d
– Heavy or optimal controllers
– Two modes: GUI and batch mode
• http://trac.clermont.cemagref.fr/projets/Kavia
r/wiki/download#Download
2
Installation and running
http://trac.clermont.cemagref.fr/projets/Kaviar/
wiki/download#Download
• Requires the java virtual machine (Sun’s JRE
environment 5 or later compulsory)
• 2 set up
– .jar file to test the models already implemented
– .zip file to implement new models
3
GUI mode
• Display window
• Console window
4
GUI mode (cont)
Dynamical system settings
Control bounds
Viability constraint set
Time step
Function of the size of the grid
Study of the dynamics!!!
5
GUI mode (cont)
Viability controller config
General settings
Optimization settings
Algorithm type
Visualize the individual trajectories
- Simple: gradient descent from the
minimal values of the controls
- Double: min and max values
- Conjugate gradient
- Double conjugate gradient
6
- Newton method
GUI mode (cont)
SVM configuration
Stopping criterion of the SVMs
SVM algorithm
computation algorithm
Bandwidth
- big C : hard margin(no
misclassification)
- small C: soft margin
Only thethe
Control
gaussian
“smoothness” of
kernel
the
SVM
is implemented
function
- Small gamma: smooth
- Big gamma: less smooth
- C-SMO: see libSVM
- Simple SVM
- Balk: automative bandwidth tuning
- Soft-Balk: balk with soft margin
7
GUI mode (cont)
Execution and control
8
GUI mode (cont)
Indicators + logs
9
Example on the population problem
• Viability kernel approximation
– Play with dt, # time steps, # points (and show
trajectories)
• To obtain a “good” approximation, the dt value must be
chosen accordingly the number of points and time steps
• Inner approximation sometimes…
– Save the results and reload them
10
Example on the population problem
• Controller – Kernel approx with dt = 0.05, 6
time steps, 31 points
– A point out of the viability kernel approximation
• x0 = 2, y0 = 0.8, 20 time steps, 3 time steps anticipation, 3
distance SVM, dist(K) = 0.025
– Inside the viability kernel
• x0 = 2, y0 = 0.5, 150 time steps
– More time steps anticipation: 15
– Bigger SVM value: 30
– Same parameters, with 1 time step for the viability
11
kernel approximation
Adding a dynamical system
• Creation of a new class file (for instance MyClass.java)
– Extend Dynamic_System if viability kernel approximation
– Extend Dynamic_System_Target if capture basins approximation
– Extend Dynamic_System_Resilience if resilience values
• In this class, create a main method to add your model and launch
the software
Public static void main (String[]args){
//init
Kaviar kaviar = new Kaviar();
//Optional: to add default models
Kaviar.addModels(Kaviar.DEFAULT_MODEL);
//Optional: to add one of the default models
//Kaviar.addModels(Population.class);
//replace my model by the name of your model
Kaviar.addModels(MyModel.class);
//Launch the GUI
Kaviar.startGUI();
}
12
MyClass.java (extends Dynamical_System)
13
MyClass.java (extends Dynamical_System_Target)
Previous +
14
MyClass.java (extends Dynamical_System_Resilience)
Previous +
15
Example on the Abrams&Strogatz model
• Dynamics and constraints
– 2 languages A and B in competition, no bilingual people
• σA: density of speakers of language A (in % - [0;1]).
• Parameter a: volatility of language A (a > 1 leads a scenario of
dominance of 1 language)
• Parameter s: prestige of language A (s = 0.5: the two languages are
socially equivalent – [0;1])
– Government, institution etc. can play on the prestige of
one language, but modifications take time
– We consider that one language is endangered when its
proportion of speakers is less that 20%
– with
16
Example on the Abrams&Strogatz model
• Resilience values
– Endangered language doesn’t mean that the
language is dead. Is there any action policies that
allows the system to recover?
– At which cost?
• λ = 1: measure the time the system is deprived from its
property of interest
• λ = c1*time + c2(distance(σA from viability))
17
•…
Example on the Abrams&Strogatz model
• Optimal control
– Compute the resilience values with the following
parameters:
• dt =0.2, dc = 0.5, double optimization, C0 = 1, C1 = 300,
31 points, 6 time steps, inner approx
• a = 2: dominance of one language
• a = 0.2: stable coexistence
– Control of the system:
• x0 =0.95, y0= 0.95 and x0 =0.7, y0= 0.95
• Optimal control outside the viability kernel
• Heavy control once the system is back to the kernel
18
Batch mode
• .simu files are needed
• Create them following a given template
• Use the GUI interface
• java -cp Kaviar-1.1.jar Appli/Batch Conso.simu
• 2 files: .svm + .log files, in the Conso… directory
19
Batch mode
• java -cp Kaviar-1.1.jar Appli/Batch Conso.simu -v
• 9*2 files: .svm + .log files, in the Conso… directory
20