CerebNet.utils.misc¶
- CerebNet.utils.misc.load_classwise_weights(cfg)[source]¶
Loading class-wise median frequency weights.
- CerebNet.utils.misc.plot_confusion_matrix(cm, classes, title='Confusion matrix', cmap=<matplotlib.colors.LinearSegmentedColormap object>, figsize=(20, 20), file_save_name=None)[source]¶
This function prints and plots the confusion matrix.
- Parameters:
- cm
np.ndarray
Confusion matrix.
- classes
list
List of classes.
- title
str
, default=”Confusion matrix” Title of the confusion matrix.
- cmap
plt.cm
, default=matplotlib.pyplot.cm.Blues Color map.
- figsize
tuple
, default=(20, 20) Figure size.
- file_save_name
str
,optional
File save name.
- cm
- Returns:
- fig
plt.Figure
Figure object.
- fig
- CerebNet.utils.misc.plot_predictions(images_batch, labels_batch, batch_output, plt_title)[source]¶
Function to plot predictions from validation set. :param images_batch: :param labels_batch: :param batch_output: :param plt_title: :param file_save_name: :return:
- CerebNet.utils.misc.set_summary_path(cfg)[source]¶
Set last experiment number(EXPR_NUM) and updates the summary path accordingly.
- Parameters:
- cfg
yacs.config.CfgNode
Configuration node.
- cfg
- CerebNet.utils.misc.update_results_dir(cfg)[source]¶
It will update the results path by finding the last experiment number.
- Parameters:
- cfg
yacs.config.CfgNode
Configuration node.
- cfg