(Y_true, Y_preds, epoch)
| 183 | |
| 184 | |
| 185 | def level_errors(Y_true, Y_preds, epoch): |
| 186 | errors = np.mean((Y_true - Y_preds), axis=0) |
| 187 | colours = ['red' if x < 0 else 'green' for x in errors] |
| 188 | index = np.arange(0, len(colours), 1) |
| 189 | |
| 190 | # Draw plot |
| 191 | lev_fig = plt.figure(figsize=(14, 14), dpi=80) |
| 192 | plt.hlines(y=index, xmin=0, xmax=errors) |
| 193 | for x, y, tex in zip(errors, index, errors): |
| 194 | t = plt.text(x, y, round(tex, 2), horizontalalignment='right' if x < 0 else 'left', |
| 195 | verticalalignment='center', fontdict={'color': 'red' if x < 0 else 'green', 'size': 10}) |
| 196 | |
| 197 | # Styling |
| 198 | plt.yticks(index, ['Level: ' + str(z) for z in index], fontsize=12) |
| 199 | plt.title(f'Average Level-wise error for epoch: {epoch}', fontdict={'size': 20}) |
| 200 | plt.grid(linestyle='--', alpha=0.5) |
| 201 | plt.xlim(-5, 5) |
| 202 | |
| 203 | return lev_fig |
| 204 | |
| 205 | |
| 206 | def profile_errors(Y_true, Y_preds, plot_profiles=200, var_name=None, data_dir: str = None, |
nothing calls this directly
no outgoing calls
no test coverage detected