fides/minimize.py
def log_step(self, accepted: bool, step: Step, fval: float):
        """
        Prints diagnostic information about the current step to the log

        :param accepted:
            flag indicating whether the current step was accepted
        :param step:
            proposal step
        :param fval:
            new fval if step is accepted
        """
        normdx = norm(step.s + step.s0)

        iterspaces = max(len(str(self.get_option(Options.MAXITER))), 5) - \
            len(str(self.iteration))
        steptypespaces = 4 - len(step.type)
        reflspaces, trunspaces = [
            4 - len(str(count))
            for count in [step.reflection_count, step.truncation_count]
        ]

        if not np.isfinite(fval):
            fval = self.fval
        self.logger.info(
            f'{" " * iterspaces}{self.iteration}'
            f' | {fval if accepted else self.fval:+.3E}'
            f' | {(fval - self.fval):+.2E}'
            f' | {step.qpval:+.2E}'
            f' | {self.tr_ratio:+.2E}'
            f' | {self.delta_iter:.2E}'
            f' | {norm(self.grad):.2E}'
            f' | {normdx:.2E}'
            f' | {step.theta:.2E}'
            f' | {step.alpha:.2E}'
            f' | {step.type}{" " * steptypespaces}'
            f' | {" " * reflspaces}{step.reflection_count}'
            f' | {" " * trunspaces}{step.truncation_count}'
            f' | {int(accepted)}'
        )

        Prints diagnostic information about the current step to the log

        :param accepted:
            flag indicating whether the current step was accepted
        :param step:
            proposal step
        :param fval:
            new fval if step is accepted
        
Prints diagnostic information about the current step to the log
Prints diagnostic information about the current step to the log
def log_step(self, accepted: bool, step: Step, fval: float):
        normdx = norm(step.s + step.s0)
        iterspaces = max(len(str(self.get_option(Options.MAXITER))), 5) - \
            len(str(self.iteration))
        steptypespaces = 4 - len(step.type)
        reflspaces, trunspaces = [
            4 - len(str(count))
            for count in [step.reflection_count, step.truncation_count]
        ]
        if not np.isfinite(fval):
            fval = self.fval
        self.logger.info(
            f'{" " * iterspaces}{self.iteration}'
            f' | {fval if accepted else self.fval:+.3E}'
            f' | {(fval - self.fval):+.2E}'
            f' | {step.qpval:+.2E}'
            f' | {self.tr_ratio:+.2E}'
            f' | {self.delta_iter:.2E}'
            f' | {norm(self.grad):.2E}'
            f' | {normdx:.2E}'
            f' | {step.theta:.2E}'
            f' | {step.alpha:.2E}'
            f' | {step.type}{" " * steptypespaces}'
            f' | {" " * reflspaces}{step.reflection_count}'
            f' | {" " * trunspaces}{step.truncation_count}'
            f' | {int(accepted)}'
        )
def log_step ( self , accepted : bool , step : Step , fval : float ) : normdx = norm ( step . s + step . s0 ) iterspaces = max ( len ( str ( self . get_option ( Options . MAXITER ) ) ) , 5 ) - len ( str ( self . iteration ) ) steptypespaces = 4 - len ( step . type ) reflspaces , trunspaces = [ 4 - len ( str ( count ) ) for count in [ step . reflection_count , step . truncation_count ] ] if not np . isfinite ( fval ) : fval = self . fval self . logger . info ( f'{" " * iterspaces}{self.iteration}' f' | {fval if accepted else self.fval:+.3E}' f' | {(fval - self.fval):+.2E}' f' | {step.qpval:+.2E}' f' | {self.tr_ratio:+.2E}' f' | {self.delta_iter:.2E}' f' | {norm(self.grad):.2E}' f' | {normdx:.2E}' f' | {step.theta:.2E}' f' | {step.alpha:.2E}' f' | {step.type}{" " * steptypespaces}' f' | {" " * reflspaces}{step.reflection_count}' f' | {" " * trunspaces}{step.truncation_count}' f' | {int(accepted)}' )
Prints diagnostic information about the current step to the log
Prints diagnostic information about the current step to the log
"""
        Prints diagnostic information about the current step to the log

        :param accepted:
            flag indicating whether the current step was accepted
        :param step:
            proposal step
        :param fval:
            new fval if step is accepted
        """
self
accepted
bool
flag indicating whether the current step was accepted
flag indicating whether the current step was accepted
step
Step
None
fval
float
new fval if step is accepted
new fval if step is accepted