-
Notifications
You must be signed in to change notification settings - Fork 0
/
pltLcurve.py
28 lines (22 loc) · 955 Bytes
/
pltLcurve.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# -*- coding: utf-8 -*-
from matplotlib import pyplot as plt
def plt_lambda_rmse(lambDa, rmse, index, ax):
ax.semilogx(lambDa, rmse,'o-')
ax.semilogx(lambDa[index], rmse[index],'r+')
print("The chosen lambda is ", lambDa[index])
ax.grid(True, which='both')
# ax.plot(inv.response(), ab2, 'b-', label='fitted')
ax.set_ylim((min(rmse), max(rmse)))
ax.grid(True, which='both')
ax.set_xlabel('Regularization parameter $\lambda$')
ax.set_ylabel('Residual norm $||Gm-d||_2$')
def plt_rmse_model_norm(rmse, modelnorm, index, ax):
ax.plot(rmse, modelnorm,'o-')
ax.plot(rmse[index], modelnorm[index],'r+')
ax.grid(True, which='both')
# ax.plot(inv.response(), ab2, 'b-', label='fitted')
ax.set_ylim((min(modelnorm), max(modelnorm)))
ax.set_xlim((min(rmse), max(rmse)))
ax.grid(True, which='both')
ax.set_xlabel('Residual norm $||Gm-d||_2$')
ax.set_ylabel('Model norm $||m||_2$')