seqgra.evaluator.gradientbased.nonlinearintegratedgradientevaluator module¶
Non-linear Integrated Gradient Evaluator
- class NonlinearIntegratedGradientEvaluator(learner: seqgra.learner.learner.Learner, output_dir: str, importance_threshold: Optional[float] = None, data=None, k=5, reference=None, path_generator=None, silent: bool = False)[source]¶
Bases:
seqgra.evaluator.gradientbased.abstractgradientevaluator.AbstractGradientEvaluator
Non-linear integrated gradient evaluator for PyTorch models
- evaluate_model(set_name: str = 'test', subset_idx: Optional[List[int]] = None, subset_n: Optional[int] = None, subset_labels: Optional[List[str]] = None, subset_n_per_label: bool = True, subset_shuffle: bool = True, subset_threshold: Optional[float] = None, suppress_plots: bool = False) → Any¶
- get_layer(key_list)¶
- select_examples(set_name: str = 'test', labels: Optional[Set[str]] = None, threshold: Optional[float] = None) → seqgra.schema.AnnotatedExampleSet¶
Returns all correctly classified examples that exceed the threshold.
for the specified labels and set that exceed the threshold.
- Parameters
TODO –
- Returns
TODO
- select_n_examples(set_name: str = 'test', n: Optional[int] = None, labels: Optional[Set[str]] = None, n_per_label: bool = True, shuffle: bool = True, threshold: Optional[float] = None) → seqgra.schema.AnnotatedExampleSet¶
- static sequence_path(args, data, k)[source]¶
distances = [[1,40],[1,35],[40,3],[35,1],[4,1]] indices = [[1,2],[0,3],[0,4],[1,4],[2,3]] nddist = np.array([np.array(xi) for xi in distances]) ndinds = np.array([np.array(xi) for xi in indices]) sp = shortest_path(0,4, nddist, ndinds) print(sp)
#unit tests change numbers to test path # 0-1-3 # | # 2 # | # 4