From 408a1c27cbda41bfbbf4745c73d0e8bb5b950424 Mon Sep 17 00:00:00 2001 From: troyyyyy Date: Fri, 5 Jan 2024 11:10:56 +0800 Subject: [PATCH] [FIX] grammar check in docstring --- abl/bridge/simple_bridge.py | 4 ++-- abl/data/evaluation/base_metric.py | 4 ++-- abl/data/evaluation/symbol_accuracy.py | 2 +- abl/learning/abl_model.py | 2 +- abl/learning/basic_nn.py | 2 +- abl/learning/model_converter.py | 4 ++-- abl/utils/utils.py | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/abl/bridge/simple_bridge.py b/abl/bridge/simple_bridge.py index f8a1c9a..845fdbd 100644 --- a/abl/bridge/simple_bridge.py +++ b/abl/bridge/simple_bridge.py @@ -233,10 +233,10 @@ class SimpleBridge(BaseBridge): Data will be split into segments of this size and data in each segment will be used together to train the model, by default 1.0. eval_interval : int - The model will be evaluated every ``eval_interval`` loops during training, + The model will be evaluated every ``eval_interval`` loop during training, by default 1. save_interval : int, optional - The model will be saved every ``eval_interval`` loops during training, by + The model will be saved every ``eval_interval`` loop during training, by default None. save_dir : str, optional Directory to save the model, by default None. diff --git a/abl/data/evaluation/base_metric.py b/abl/data/evaluation/base_metric.py index 61f6428..59824d3 100644 --- a/abl/data/evaluation/base_metric.py +++ b/abl/data/evaluation/base_metric.py @@ -52,7 +52,7 @@ class BaseMetric(metaclass=ABCMeta): ------- dict The computed metrics. The keys are the names of the metrics, - and the values are corresponding results. + and the values are the corresponding results. """ def evaluate(self) -> dict: @@ -64,7 +64,7 @@ class BaseMetric(metaclass=ABCMeta): ------- dict Evaluation metrics dict on the val dataset. The keys are the - names of the metrics, and the values are corresponding results. + names of the metrics, and the values are the corresponding results. """ if len(self.results) == 0: print_log( diff --git a/abl/data/evaluation/symbol_accuracy.py b/abl/data/evaluation/symbol_accuracy.py index 33d1df4..0eac6ca 100644 --- a/abl/data/evaluation/symbol_accuracy.py +++ b/abl/data/evaluation/symbol_accuracy.py @@ -11,7 +11,7 @@ class SymbolAccuracy(BaseMetric): A metrics class for evaluating symbol-level accuracy. This class is designed to assess the accuracy of symbol prediction. Symbol accuracy - are calculated by comparing predicted presudo labels and their ground truth. + is calculated by comparing predicted presudo labels and their ground truth. Parameters ---------- diff --git a/abl/learning/abl_model.py b/abl/learning/abl_model.py index 6ceb798..3c2a122 100644 --- a/abl/learning/abl_model.py +++ b/abl/learning/abl_model.py @@ -86,7 +86,7 @@ class ABLModel: Returns ------- float - The accuracy the trained model. + The accuracy of the trained model. """ data_X = data_examples.flatten("X") data_y = data_examples.flatten("abduced_idx") diff --git a/abl/learning/basic_nn.py b/abl/learning/basic_nn.py index e35328a..b2309e0 100644 --- a/abl/learning/basic_nn.py +++ b/abl/learning/basic_nn.py @@ -40,7 +40,7 @@ class BasicNN: num_workers : int The number of workers used for loading data, by default 0. save_interval : int, optional - The model will be saved every ``save_interval`` epochs during training, by default None. + The model will be saved every ``save_interval`` epoch during training, by default None. save_dir : str, optional The directory in which to save the model during training, by default None. train_transform : Callable[..., Any], optional diff --git a/abl/learning/model_converter.py b/abl/learning/model_converter.py index 0f79ce9..20f77b9 100644 --- a/abl/learning/model_converter.py +++ b/abl/learning/model_converter.py @@ -63,7 +63,7 @@ class ModelConverter: num_workers : int The number of workers used for loading data, by default 0. save_interval : int, optional - The model will be saved every ``save_interval`` epochs during training, by default None. + The model will be saved every ``save_interval`` epoch during training, by default None. save_dir : str, optional The directory in which to save the model during training, by default None. train_transform : Callable[..., Any], optional @@ -153,7 +153,7 @@ class ModelConverter: num_workers : int The number of workers used for loading data, by default 0. save_interval : int, optional - The model will be saved every ``save_interval`` epochs during training, by default None. + The model will be saved every ``save_interval`` epoch during training, by default None. save_dir : str, optional The directory in which to save the model during training, by default None. train_transform : Callable[..., Any], optional diff --git a/abl/utils/utils.py b/abl/utils/utils.py index 66e83f8..77453b3 100644 --- a/abl/utils/utils.py +++ b/abl/utils/utils.py @@ -94,7 +94,7 @@ def confidence_dist(pred_prob: List[np.ndarray], candidates_idxs: List[List[Any] Parameters ---------- pred_prob : List[np.ndarray] - Prediction probability distributions, each element is an ndarray + Prediction probability distributions, each element is an array representing the probability distribution of a particular prediction. candidates_idxs : List[List[Any]] Multiple possible candidates' indices.