Skip to content
ericdow edited this page Mar 25, 2013 · 6 revisions

ERIC (3/25): I've renamed everything to be 'asm'. 'dimred' was definitely a placeholder. I kind of agree with Paul on keeping things as two modules. I wanted to separate the ASM stuff (only 60 lines!) from the response surface stuff. It creates a better mental divide between the two pieces, and allows the user to plug in different response surfaces.

I added a call method to the Kriging class. Now you can do:

from kriging import Kriging kr = Kriging(asm, M, n, Nd) # create a kriging object print kr(x0) # evaluate at some point

PAUL (3/24): Can we refactor it to call it ASM (for active subspace method) instead of dimred?

PAUL (3/24): I'm personally okay with two separate modules: one for computing directions and building the design on the subspace, and one for response surface construction. This way we can in principle use different response surfaces. And having a separate response surface module could be useful apart from the dimension reduction and subspace projection.

QIQI (3/23): Eric, I looked at the code again. I think it's organized in a better way than Thursday's code. However, I think putting everything into a single file would be better than splitting the code into two files. Unlike Matlab which needs a separate file for each function, you can have as many classes and functions in a file as you want. We'll have two classes in a file, but that's not much at all. The user would then just need to import one module, not two.

Another change I suggest is having dimred class to generate an instance of the kriging class. That is to implement a method in the dimred class, which takes argument of n and Nd, and returns an instance of the kriging class.

Also it's good to implement a call method of the kriging class, as a wrapper of "evaluate". This way the user can do:

from dimred import Dimred
dr = Dimred(f, m, Nsamples)
f = dr.kriging(n, 1)
print f(0), f(1), f(2)

This is much more "Pythonic"...

Clone this wiki locally