dpgen2.exploration.report package

Submodules

dpgen2.exploration.report.report module

class dpgen2.exploration.report.report.ExplorationReport[source]

Bases: ABC

Methods

clear()

Clear the report

converged(reports)

Check if the exploration is converged.

get_candidate_ids([max_nframes])

Get indexes of candidate configurations

no_candidate()

If no candidate configuration is found

print(stage_idx, idx_in_stage, iter_idx)

Print the report

print_header()

Print the header of report

record(model_devi)

Record the model deviations of the trajectories

abstract clear()[source]

Clear the report

abstract converged(reports) bool[source]

Check if the exploration is converged.

Parameters:
reports

Historical reports

Returns:
converged bool

If the exploration is converged.

abstract get_candidate_ids(max_nframes: int | None = None) List[List[int]][source]

Get indexes of candidate configurations

Parameters:
max_nframes

The maximal number of frames of candidates.

Returns:
idx: List[List[int]]

The frame indices of candidate configurations. idx[ii][jj] is the frame index of the jj-th candidate of the ii-th trajectory.

no_candidate() bool[source]

If no candidate configuration is found

abstract print(stage_idx: int, idx_in_stage: int, iter_idx: int) str[source]

Print the report

abstract print_header() str[source]

Print the header of report

abstract record(model_devi: DeviManager)[source]

Record the model deviations of the trajectories

Parameters:
model_deviDeviManager

The class which is responsible for model deviation management. Model deviations is stored as a List[Optional[np.ndarray]], where np.array is a one-dimensional array. List[np.ndarray][ii][jj] is the force model deviation of the jj-th frame of the ii-th trajectory. Model deviations can be List[None], where len(List[None]) is the number of trajectory files.

dpgen2.exploration.report.report_adaptive_lower module

class dpgen2.exploration.report.report_adaptive_lower.ExplorationReportAdaptiveLower(level_f_hi: float = 0.5, numb_candi_f: int = 200, rate_candi_f: float = 0.01, level_v_hi: float | None = None, numb_candi_v: int = 0, rate_candi_v: float = 0.0, n_checked_steps: int = 2, conv_tolerance: float = 0.05, candi_sel_prob: str = 'uniform')[source]

Bases: ExplorationReport

The exploration report that adapts the lower trust level.

This report will treat a fixed number of frames that has force model deviation lower than level_f_hi, and virial model deviation lower than level_v_hi as candidates.

The number of force frames is given by max(numb_candi_f, rate_candi_f * nframes) The number of virial frames is given by max(numb_candi_v, rate_candi_v * nframes)

The lower force trust level will be set to the lowest force model deviation of the force frames. The lower virial trust level will be set to the lowest virial model deviation of the virial frames

The exploration will be treat as converged if the differences in model deviations in the neighboring steps are less than conv_tolerance in the last n_checked_steps.

Parameters:
level_f_hi float

The higher trust level of force model deviation

numb_candi_f int

The number of force frames that has a model deviation lower than level_f_hi treated as candidate.

rate_candi_f float

The ratio of force frames that has a model deviation lower than level_f_hi treated as candidate.

level_v_hi float

The higher trust level of virial model deviation

numb_candi_v int

The number of virial frames that has a model deviation lower than level_v_hi treated as candidate.

rate_candi_v float

The ratio of virial frames that has a model deviation lower than level_v_hi treated as candidate.

n_checked_steps int

The number of steps to check the convergence.

conv_tolerance float

The convergence tolerance.

candi_sel_prob str

The method for selecting candidates. It can be “uniform”: all candidates are of the same probability. “inv_pop_f” or “inv_pop_f:nhist”: the probability is inversely propotional to the population of a histogram between level_f_lo and level_f_hi. The number of bins in the histogram is set by nhist, which should be an integer. The default is 10.

Methods

clear()

Clear the report

converged(reports)

Check if the exploration is converged.

get_candidate_ids([max_nframes])

Get indexes of candidate configurations

no_candidate()

If no candidate configuration is found

print(stage_idx, idx_in_stage, iter_idx)

Print the report

print_header()

Print the header of report

record(model_devi)

Record the model deviations of the trajectories

accurate_ratio

args

candidate_ratio

doc

failed_ratio

accurate_ratio(tag=None)[source]
static args() List[Argument][source]
candidate_ratio(tag=None)[source]
clear()[source]

Clear the report

converged(reports) bool[source]

Check if the exploration is converged.

Parameters:
reports

Historical reports

Returns:
converged bool

If the exploration is converged.

static doc() str[source]
failed_ratio(tag=None)[source]
get_candidate_ids(max_nframes: int | None = None) List[List[int]][source]

Get indexes of candidate configurations

Parameters:
max_nframes

The maximal number of frames of candidates.

Returns:
idx: List[List[int]]

The frame indices of candidate configurations. idx[ii][jj] is the frame index of the jj-th candidate of the ii-th trajectory.

print(stage_idx: int, idx_in_stage: int, iter_idx: int) str[source]

Print the report

print_header() str[source]

Print the header of report

record(model_devi: DeviManager)[source]

Record the model deviations of the trajectories

Parameters:
model_deviDeviManager

The class which is responsible for model deviation management. Model deviations is stored as a List[Optional[np.ndarray]], where np.array is a one-dimensional array. List[np.ndarray][ii][jj] is the force model deviation of the jj-th frame of the ii-th trajectory. Model deviations can be List[None], where len(List[None]) is the number of trajectory files.

dpgen2.exploration.report.report_trust_levels_base module

class dpgen2.exploration.report.report_trust_levels_base.ExplorationReportTrustLevels(level_f_lo, level_f_hi, level_v_lo=None, level_v_hi=None, conv_accuracy=0.9)[source]

Bases: ExplorationReport

Methods

clear()

Clear the report

converged([reports])

Check if the exploration is converged.

get_candidate_ids([max_nframes])

Get indexes of candidate configurations

no_candidate()

If no candidate configuration is found

print(stage_idx, idx_in_stage, iter_idx)

Print the report

print_header()

Print the header of report

record(model_devi)

Record the model deviations of the trajectories

accurate_ratio

args

candidate_ratio

failed_ratio

accurate_ratio(tag=None)[source]
static args() List[Argument][source]
candidate_ratio(tag=None)[source]
clear()[source]

Clear the report

abstract converged(reports: List[ExplorationReport] | None = None) bool[source]

Check if the exploration is converged.

Parameters:
reports

Historical reports

Returns:
converged bool

If the exploration is converged.

failed_ratio(tag=None)[source]
abstract get_candidate_ids(max_nframes: int | None = None) List[List[int]][source]

Get indexes of candidate configurations

Parameters:
max_nframes

The maximal number of frames of candidates.

Returns:
idx: List[List[int]]

The frame indices of candidate configurations. idx[ii][jj] is the frame index of the jj-th candidate of the ii-th trajectory.

print(stage_idx: int, idx_in_stage: int, iter_idx: int) str[source]

Print the report

print_header() str[source]

Print the header of report

record(model_devi: DeviManager)[source]

Record the model deviations of the trajectories

Parameters:
model_deviDeviManager

The class which is responsible for model deviation management. Model deviations is stored as a List[Optional[np.ndarray]], where np.array is a one-dimensional array. List[np.ndarray][ii][jj] is the force model deviation of the jj-th frame of the ii-th trajectory. Model deviations can be List[None], where len(List[None]) is the number of trajectory files.

dpgen2.exploration.report.report_trust_levels_max module

class dpgen2.exploration.report.report_trust_levels_max.ExplorationReportTrustLevelsMax(level_f_lo, level_f_hi, level_v_lo=None, level_v_hi=None, conv_accuracy=0.9)[source]

Bases: ExplorationReportTrustLevels

Methods

clear()

Clear the report

converged([reports])

Check if the exploration is converged.

get_candidate_ids([max_nframes])

Get indexes of candidate configurations

no_candidate()

If no candidate configuration is found

print(stage_idx, idx_in_stage, iter_idx)

Print the report

print_header()

Print the header of report

record(model_devi)

Record the model deviations of the trajectories

accurate_ratio

args

candidate_ratio

doc

failed_ratio

converged(reports: List[ExplorationReport] | None = None) bool[source]

Check if the exploration is converged.

Parameters:
reports

Historical reports

Returns:
converged bool

If the exploration is converged.

static doc() str[source]
get_candidate_ids(max_nframes: int | None = None) List[List[int]][source]

Get indexes of candidate configurations

Parameters:
max_nframes

The maximal number of frames of candidates.

Returns:
idx: List[List[int]]

The frame indices of candidate configurations. idx[ii][jj] is the frame index of the jj-th candidate of the ii-th trajectory.

dpgen2.exploration.report.report_trust_levels_random module

class dpgen2.exploration.report.report_trust_levels_random.ExplorationReportTrustLevelsRandom(level_f_lo, level_f_hi, level_v_lo=None, level_v_hi=None, conv_accuracy=0.9)[source]

Bases: ExplorationReportTrustLevels

Methods

clear()

Clear the report

converged([reports])

Check if the exploration is converged.

get_candidate_ids([max_nframes])

Get indexes of candidate configurations

no_candidate()

If no candidate configuration is found

print(stage_idx, idx_in_stage, iter_idx)

Print the report

print_header()

Print the header of report

record(model_devi)

Record the model deviations of the trajectories

accurate_ratio

args

candidate_ratio

doc

failed_ratio

converged(reports: List[ExplorationReport] | None = None) bool[source]

Check if the exploration is converged.

Parameters:
reports

Historical reports

Returns:
converged bool

If the exploration is converged.

static doc() str[source]
get_candidate_ids(max_nframes: int | None = None) List[List[int]][source]

Get indexes of candidate configurations

Parameters:
max_nframes

The maximal number of frames of candidates.

Returns:
idx: List[List[int]]

The frame indices of candidate configurations. idx[ii][jj] is the frame index of the jj-th candidate of the ii-th trajectory.