rfho/examples/common.py
def scalar_value_gradient_plotter(value_color, gradient_color, value_kwargs=None, grad_kwargs=None):
    """
    This is a plotter thought for stream_dict that contains hyperparameters values and hyper-gradients.
    Will plot these two scalar sequences on different scales.

    :param grad_kwargs:
    :param value_kwargs:
    :param value_color:
    :param gradient_color:
    :return:
    """
    value_kwargs = value_kwargs or {}
    grad_kwargs = grad_kwargs or {}

    ax2 = None

    def intern(ax, stream_dict, **kwargs):
        nonlocal ax2

        ax.clear()
        if ax2 is None:
            ax2 = ax.twinx()
        ax2.clear()

        data = list(stream_dict.values())[0]
        val = [c[0] for c in data]
        grad = [c[1] for c in data]

        val_line, = ax.plot(val, color=value_color, **merge_dicts(kwargs, value_kwargs))
        grad_line, = ax2.plot(grad, color=gradient_color, **merge_dicts(kwargs, grad_kwargs))
        ax.legend((val_line, grad_line), ('Value', 'Gradient'), loc=0)
    return intern

    This is a plotter thought for stream_dict that contains hyperparameters values and hyper-gradients.
    Will plot these two scalar sequences on different scales.

    :param grad_kwargs:
    :param value_kwargs:
    :param value_color:
    :param gradient_color:
    :return:
    
This is a plotter thought for stream_dict that contains hyperparameters values and hyper-gradients.
Will plot these two scalar sequences on different scales.
This is a plotter thought for stream_dict that contains hyperparameters values and hyper - gradients . Will plot these two scalar sequences on different scales .
def scalar_value_gradient_plotter(value_color, gradient_color, value_kwargs=None, grad_kwargs=None):
    value_kwargs = value_kwargs or {}
    grad_kwargs = grad_kwargs or {}
    ax2 = None
    def intern(ax, stream_dict, **kwargs):
        nonlocal ax2
        ax.clear()
        if ax2 is None:
            ax2 = ax.twinx()
        ax2.clear()
        data = list(stream_dict.values())[0]
        val = [c[0] for c in data]
        grad = [c[1] for c in data]
        val_line, = ax.plot(val, color=value_color, **merge_dicts(kwargs, value_kwargs))
        grad_line, = ax2.plot(grad, color=gradient_color, **merge_dicts(kwargs, grad_kwargs))
        ax.legend((val_line, grad_line), ('Value', 'Gradient'), loc=0)
    return intern
def scalar_value_gradient_plotter ( value_color , gradient_color , value_kwargs = None , grad_kwargs = None ) : value_kwargs = value_kwargs or { } grad_kwargs = grad_kwargs or { } ax2 = None def intern ( ax , stream_dict , ** kwargs ) : nonlocal ax2 ax . clear ( ) if ax2 is None : ax2 = ax . twinx ( ) ax2 . clear ( ) data = list ( stream_dict . values ( ) ) [ 0 ] val = [ c [ 0 ] for c in data ] grad = [ c [ 1 ] for c in data ] val_line , = ax . plot ( val , color = value_color , ** merge_dicts ( kwargs , value_kwargs ) ) grad_line , = ax2 . plot ( grad , color = gradient_color , ** merge_dicts ( kwargs , grad_kwargs ) ) ax . legend ( ( val_line , grad_line ) , ( 'Value' , 'Gradient' ) , loc = 0 ) return intern
This is a plotter thought for stream_dict that contains hyperparameters values and hyper-gradients.
This is a plotter thought for stream_dict that contains hyperparameters values and hyper - gradients .
"""
    This is a plotter thought for stream_dict that contains hyperparameters values and hyper-gradients.
    Will plot these two scalar sequences on different scales.

    :param grad_kwargs:
    :param value_kwargs:
    :param value_color:
    :param gradient_color:
    :return:
    """
None
value_color
None
gradient_color
None
value_kwargs
None
grad_kwargs
None