Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove duplication of examples and tests (#95)
* Added ex 6.3 to docs/source/examples/ * Deleted gpfit/examples/ dir * Consolidated ex 6.3 into t_examples (deleted t_ex6_3.py)
- Loading branch information
Showing
8 changed files
with
46 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
"Example 6.3 from Hoburg/Abbeel GPfit paper" | ||
import numpy as np | ||
from numpy.random import seed, random_sample | ||
from gpfit.fit import fit | ||
|
||
seed(33404) | ||
|
||
Vdd = random_sample(1000,) + 1 | ||
Vth = 0.2*random_sample(1000,) + 0.2 | ||
P = Vdd**2 + 30*Vdd*np.exp(-(Vth - 0.06*Vdd)/0.039) | ||
u = np.vstack((Vdd, Vth)) | ||
x = np.log(u) | ||
y = np.log(P) | ||
K = 4 | ||
|
||
_, errorMA = fit(x, y, K, "MA") | ||
_, errorSMA = fit(x, y, K, "SMA") | ||
_, errorISMA = fit(x, y, K, "ISMA") | ||
|
||
print("MA RMS Error: %.5g" % errorMA) | ||
print("SMA RMS Error: %.5g" % errorSMA) | ||
print("ISMA RMS Error: %.5g" % errorISMA) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
MA fit from params | ||
w = 0.0877784 * (u_1)**2.3499 * (u_2)**-1.86683 | ||
w = 0.824389 * (u_1)**2.02321 * (u_2)**-0.203195 | ||
w = 0.0175649 * (u_1)**2.84017 * (u_2)**-2.78935 | ||
w = 0.38541 * (u_1)**2.13119 * (u_2)**-0.826143 | ||
SMA fit from params | ||
w**2.22467 = 5.42035e-05 * (u_1)**5.24451 * (u_2)**-6.68343 | ||
+ 3.61239e-08 * (u_1)**9.613 * (u_2)**-9.4893 | ||
+ 1.07674e-05 * (u_1)**0.538839 * (u_2)**-6.12098 | ||
+ 1.0777 * (u_1)**4.43371 * (u_2)**0.0978425 | ||
ISMA fit from params | ||
1 = (0.309986/w**0.309511) * (u_1)**0.6327 * (u_2)**-0.813931 | ||
+ (0.012176/w**0.67353) * (u_1)**2.61311 * (u_2)**-2.59033 | ||
+ (0.889774/w**0.242028) * (u_1)**0.485343 * (u_2)**-0.0942005 | ||
+ (1.00588/w**0.0753052) * (u_1)**0.149934 * (u_2)**0.0116639 | ||
MA RMS Error: 0.007382 | ||
SMA RMS Error: 0.00016261 | ||
ISMA RMS Error: 0.00017923 |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters