shiba/schedulers.py
def compute_momentum(self):
        """
         Compute the momentum based on which phase of the cycle it is in.
        - If in the first half of training, the momentum gradually decreases.
        - If in the second half of training, the momentum gradually increases.
        - If in the final `end_percentage` portion of training, the momentum value
            is kept constant at the maximum initial value.
        # Returns:
            the new momentum value
        """
        if self.clr_iterations > 2 * self.mid_cycle_id:
            new_momentum = self.max_momentum

        elif self.clr_iterations > self.mid_cycle_id:
            current_percentage = 1. - ((self.clr_iterations - self.mid_cycle_id) / float(
                self.mid_cycle_id))
            new_momentum = self.max_momentum - current_percentage * (
                    self.max_momentum - self.min_momentum)

        else:
            current_percentage = self.clr_iterations / float(self.mid_cycle_id)
            new_momentum = self.max_momentum - current_percentage * (
                    self.max_momentum - self.min_momentum)

        return new_momentum

         Compute the momentum based on which phase of the cycle it is in.
        - If in the first half of training, the momentum gradually decreases.
        - If in the second half of training, the momentum gradually increases.
        - If in the final `end_percentage` portion of training, the momentum value
            is kept constant at the maximum initial value.
        # Returns:
            the new momentum value
        
Compute the momentum based on which phase of the cycle it is in.
If in the first half of training, the momentum gradually decreases.
If in the second half of training, the momentum gradually increases.
If in the final `end_percentage` portion of training, the momentum value
is kept constant at the maximum initial value.
Returns:
the new momentum value
Compute the momentum based on which phase of the cycle it is in . If in the first half of training the momentum gradually decreases . If in the second half of training the momentum gradually increases . If in the final ` end_percentage ` portion of training the momentum value is kept constant at the maximum initial value . Returns : the new momentum value
def compute_momentum(self):
        if self.clr_iterations > 2 * self.mid_cycle_id:
            new_momentum = self.max_momentum
        elif self.clr_iterations > self.mid_cycle_id:
            current_percentage = 1. - ((self.clr_iterations - self.mid_cycle_id) / float(
                self.mid_cycle_id))
            new_momentum = self.max_momentum - current_percentage * (
                    self.max_momentum - self.min_momentum)
        else:
            current_percentage = self.clr_iterations / float(self.mid_cycle_id)
            new_momentum = self.max_momentum - current_percentage * (
                    self.max_momentum - self.min_momentum)
        return new_momentum
def compute_momentum ( self ) : if self . clr_iterations > 2 * self . mid_cycle_id : new_momentum = self . max_momentum elif self . clr_iterations > self . mid_cycle_id : current_percentage = 1. - ( ( self . clr_iterations - self . mid_cycle_id ) / float ( self . mid_cycle_id ) ) new_momentum = self . max_momentum - current_percentage * ( self . max_momentum - self . min_momentum ) else : current_percentage = self . clr_iterations / float ( self . mid_cycle_id ) new_momentum = self . max_momentum - current_percentage * ( self . max_momentum - self . min_momentum ) return new_momentum
Compute the momentum based on which phase of the cycle it is in.
Compute the momentum based on which phase of the cycle it is in .
"""
         Compute the momentum based on which phase of the cycle it is in.
        - If in the first half of training, the momentum gradually decreases.
        - If in the second half of training, the momentum gradually increases.
        - If in the final `end_percentage` portion of training, the momentum value
            is kept constant at the maximum initial value.
        # Returns:
            the new momentum value
        """
self