Utils


source

plot_loss_and_acc

 plot_loss_and_acc (log_dir, loss_ylim=(0.0, 0.9), acc_ylim=(0.7, 1.0),
                    save_loss=None, save_acc=None)

source

show_img

 show_img (img, cmap=None, titles=[''], figsize=(7, 7))

source

plt_show

 plt_show (im, cmap=None, title='', figsize=(7, 7))

source

tensor_to_img

 tensor_to_img (t)

source

is_tensor

 is_tensor (x)

source

update_norm

 update_norm (tfms, mean, std, idx=None)

source

del_norm

 del_norm (tfms, idx=None)

source

get_norm_id

 get_norm_id (tfms)

source

is_norm

 is_norm (x)

source

get_norm

 get_norm (tfms)

source

unfreeze_model

 unfreeze_model (model)

source

freeze_model

 freeze_model (model)

source

unfreeze_params

 unfreeze_params (params)

source

freeze_params

 freeze_params (params)

source

is_unfrozen

 is_unfrozen (model)

source

is_frozen

 is_frozen (model)

source

params

 params (m)

source

is_sequential

 is_sequential (x)

source

UnNormalize

 UnNormalize (mean, std, *args, **kwargs)

Normalize a tensor image with mean and standard deviation. This transform does not support PIL Image. Given mean: (mean[1],...,mean[n]) and std: (std[1],..,std[n]) for n channels, this transform will normalize each channel of the input torch.*Tensor i.e., output[channel] = (input[channel] - mean[channel]) / std[channel]

.. note:: This transform acts out of place, i.e., it does not mutate the input tensor.

Args: mean (sequence): Sequence of means for each channel. std (sequence): Sequence of standard deviations for each channel. inplace(bool,optional): Bool to make this operation in-place.