deepaugment/objective.py
def calculate_reward(self, history):
        """Calculates reward for the history.

        Reward is mean of largest n validation accuracies which are not overfitting.
        n is determined by the user by `opt_last_n_epochs` argument. A validation
        accuracy is considered as overfitting if the training accuracy in the same
        epoch is larger by 0.05

        Args:
            history (dict): dictionary of loss and accuracy
        Returns:
            float: reward
        """
        history_df = pd.DataFrame(history)
        history_df["acc_overfit"] = history_df["acc"] - history_df["val_acc"]
        reward = (
            history_df[history_df["acc_overfit"] <= 0.10]["val_acc"]
            .nlargest(self.opt_last_n_epochs)
            .mean()
        )
        return reward
Calculates reward for the history.

        Reward is mean of largest n validation accuracies which are not overfitting.
        n is determined by the user by `opt_last_n_epochs` argument. A validation
        accuracy is considered as overfitting if the training accuracy in the same
        epoch is larger by 0.05

        Args:
            history (dict): dictionary of loss and accuracy
        Returns:
            float: reward
        
Calculates reward for the history.
Reward is mean of largest n validation accuracies which are not overfitting.
n is determined by the user by `opt_last_n_epochs` argument. A validation
accuracy is considered as overfitting if the training accuracy in the same
epoch is larger by 0.05
Calculates reward for the history . Reward is mean of largest n validation accuracies which are not overfitting . n is determined by the user by ` opt_last_n_epochs ` argument . A validation accuracy is considered as overfitting if the training accuracy in the same epoch is larger by 0 . 05
def calculate_reward(self, history):
        history_df = pd.DataFrame(history)
        history_df["acc_overfit"] = history_df["acc"] - history_df["val_acc"]
        reward = (
            history_df[history_df["acc_overfit"] <= 0.10]["val_acc"]
            .nlargest(self.opt_last_n_epochs)
            .mean()
        )
        return reward
def calculate_reward ( self , history ) : history_df = pd . DataFrame ( history ) history_df [ "acc_overfit" ] = history_df [ "acc" ] - history_df [ "val_acc" ] reward = ( history_df [ history_df [ "acc_overfit" ] <= 0.10 ] [ "val_acc" ] . nlargest ( self . opt_last_n_epochs ) . mean ( ) ) return reward
Calculates reward for the history.
Calculates reward for the history .
"""Calculates reward for the history.

        Reward is mean of largest n validation accuracies which are not overfitting.
        n is determined by the user by `opt_last_n_epochs` argument. A validation
        accuracy is considered as overfitting if the training accuracy in the same
        epoch is larger by 0.05

        Args:
            history (dict): dictionary of loss and accuracy
        Returns:
            float: reward
        """
None
float
self
history
dictionary of loss and accuracy
dictionary of loss and accuracy