-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
saving uncommited changes just in case, but forgot what is was about...
- Loading branch information
1 parent
f0c477b
commit 456df13
Showing
8 changed files
with
82 additions
and
21 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 |
---|---|---|
@@ -1 +1 @@ | ||
from .Factorize import Factorize, AutoFactorize | ||
from .Factorize import Factorize_, AutoFactorize |
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
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,32 @@ | ||
# Testing grad engine | ||
|
||
from keopscore.formulas import * | ||
from keopscore.utils.TestFormula import TestFormula | ||
D, Dv = 3, 2 | ||
x = Var(0, D, 0, "x") | ||
y = Var(1, D, 1, "y") | ||
b = Var(2, Dv, 1, "b") | ||
|
||
f = Exp(-SqDist(x, y)) * b | ||
print("f =", f) | ||
|
||
u = Var(3, Dv, 0, "u") | ||
|
||
g = Concat(Grad(f,x,u),Grad(f,b,u)) | ||
print("g=",g) | ||
|
||
TestFormula(g, randseed=1) | ||
|
||
g = AutoFactorize(g) | ||
print("g=",g) | ||
|
||
TestFormula(g, randseed=1) | ||
|
||
g = Grad(f,[x,b],u) | ||
print("g=",g) | ||
|
||
TestFormula(g, randseed=1) | ||
|
||
g = AutoFactorize(g) | ||
print("g=",g) | ||
TestFormula(g, randseed=1) |
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
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