What - Why - How of Validation.

HBP Codejam, Lausanne 2017

by B. Lungsi Sharma, Ph.D.
PostDoctoral Fellow, CNRS-UNIC
lungsi.sharma@unic.cnrs-gif.fr

HBP CNRS
Peter Drucker
There's a difference between doing things right and doing the right thing.
- Peter Drucker
Russell Ackoff

Doing things right is efficiency.

Doing the right thing is wisdom and effectiveness.

The righter you do the wrong thing the wronger you become.

Why?

If you do the wrong thing, make a mistake and correct it; you become wronger.

Therefore, it is better to do the right thing wrong than wrong things right.

G. K. Chesterton
Anyone setting out to dispute anything ought always to begin by saying what he does not dispute. Beyond stating what he proposes to prove he should always state what he does not propose to prove.
- G. K. Chesterton, Orthodoxy

Validation, What It Is NOT.

Validation is NOT checking that the model works the way you think it does.

Validation, What It IS.

Validation IS checking that the model does the right thing.

Francis Bacon
Francis Bacon
Therefore distance of the simulated image (i.e, intended application) will determine whether the model is valid or not.
Process of determining the degree to which a computer simulation is an accurate representation of real world from perspective of intended use of model.
- DoD Modeling and Simulation; DoE ASC Program

Validation is NOT about truth.

Model

Validation IS about control.

SciUnit Capability

Why Validate.

Francis Bacon
Francis Bacon
Francis Bacon
Francis Bacon
Francis Bacon
Francis Bacon

How To Perform Validation.

Model Maker
Model Maker
Test Maker
Model Consumer: Test Maker
Test Runner
Model Consumer: Test Runner
Validation Framework
Validation Framework
Francis Bacon

What does the model maker do?

Francis Bacon

Wrapping the model in SciUnit.

For this "real-world"

Bolshoi

We've built the model.

Model

Wrapping the model in SciUnit.

For the model

Model

Create SciUnit-Capability.

SciUnit Capability

Create SciUnit-Capability by,

# mansion_capability.py

♦ importing sciunit

import sciunit

♦ then create a class based on sciunit.Capability

class DoorStatus( sciunit.Capability ):

♦ follow this by creating a method of this class.

     def opens_door1( self ):

The method merely acts as a scaffold.

          raise NotImplementedError( "Must
          implement opens_door1 method."
)

Wrapping the model in SciUnit.

Once the SciUnit-Capability is created.

Model

Implement this capability in the model.

SciUnit Capability

Implement the capability in the model by,

# mansion_model.py

♦ importing sciunit

import sciunit

♦ importing the created mansion_capability

from mansion_capability import DoorStatus

♦ then create a class based on sciunit.Model

class MansionModel( sciunit.Model,
                                             DoorStatus ):

♦ follow this by creating a method of this class, with the same name as in DoorStatus class.

     def opens_door1( self, r = 0, F = 0,
                                             theta = 0 ):

          return (r*F*sin(theta)) # torque

This wraps the model in SciUnit.

Francis Bacon

What does the test maker do?

Francis Bacon
Francis Bacon

Wrapping the test in SciUnit.

This is done by implementing the capability (we created earlier) in the test.

SciUnit Capability

Implement the capability in the test by,

# mansion_door_test.py

♦ importing sciunit

import sciunit

♦ importing the created mansion_capability

from mansion_capability import DoorStatus

♦ then create a class based on sciunit.Test

class MansionDoor1Test( sciunit.Test ):

♦ set required_capabilities and score_type

     required_capabilites = (DoorStatus, )
     score_type = sciunit.Score.<some_score>

♦ follow this by creating the method generate_prediction

     def generate_prediction( self, model ):
          return model.opens_door1(r=1.3, F=5, theta=70)

♦ then create the method compute_score

     def compute_score( self, prediction, observation ):
          return self.score_type( prediction ==
                                                            observation )

This wraps the test in SciUnit.

Francis Bacon

What does the test runner do?

Francis Bacon

Running the model & test wrapped in SciUnit.

Francis Bacon

					>> from mansion_model import MansionModel
					>> from mansion_door_test import MansionDoor1Test
					
					# observation data of 6 Nm torque
					>> vtest = MansionDoor1Test( 6 )
					
					# get the computed score
					>> score = vtest.judge( MansionModel )
					

Individual tests can form a test suite.

Francis Bacon
Francis Bacon

Validation Framework Workflow

Francis Bacon

Validation Framework Components

Francis Bacon
Francis Bacon
Francis Bacon
Francis Bacon


									>> import models
									
									>> desired_test_uri =
										"https://validation.brainsimulation.eu/tests/1"
									
									>> from hbp_validation_framework import ValidationTestLibrary
									
									>> test_library = ValidationTestLibrary(username="lungsi")
									
									>> test = test_library.get_validation_test(desired_test_uri,
														show_plot=True)
									
									>> score = test.judge(getattr(models, 'Bianchi')(),
												deep_error=True)
																	
									>> from hbp_validation_framework.datastores import CollabDataStore
									
									>> collab_storage = CollabDataStore(username="lungsi",
											collab_id="1655",
											base_folder="VUC_Bianchi_DepolTest_results")
									
									>> test_library.register(score, collab_storage)
									

SciUnit Capability

Francis Bacon
Francis Bacon

Credits

            Andrew Davison Team, CNRS-UNIC:
Andrew Davison, Shailesh Appukuttan, Onur Ates, Jonathan Dupperrier, Helissande Fragnaud, Pedro Garcia, Joffrey Gonin, Dominico Guarion, Elodie Legouee & Lungsi Sharma.
            Peter Drucker (Image). https://ffbsccn.files.wordpress.com/2010/08/peter_drucker.jpg
            Russell Ackoff (Image). http://management.curiouscatblog.net/images/russell_ackoff.jpg
            G. K Chesterton (Image). https://upload.wikimedia.org/wikipedia/commons/7/75/Gilbert_Chesterton.jpg
            Shailesh Appukuttan Reviewer's part of Why validate?.

Thank you.