Adjustments to Taguchi optimisation structure.

这个提交包含在:
Craig Warren
2016-01-25 10:15:45 +00:00
父节点 96ad288fc8
当前提交 0cd968bc7e
共有 3 个文件被更改,包括 53 次插入24 次删除

查看文件

@@ -16,6 +16,7 @@
# You should have received a copy of the GNU General Public License
# along with gprMax. If not, see <http://www.gnu.org/licenses/>.
import os
from collections import OrderedDict
import numpy as np
@@ -23,6 +24,8 @@ import numpy as np
from gprMax.constants import floattype
from gprMax.exceptions import CmdInputError
moduledirectory = os.path.dirname(os.path.abspath(__file__))
def taguchi_code_blocks(inputfile, taguchinamespace):
"""Looks for and processes a Taguchi code block (containing Python code) in the input file. It will ignore any lines that are comments, i.e. begin with a double hash (##), and any blank lines.
@@ -88,6 +91,32 @@ def construct_OA(optparams):
# Number of parameters to optimise
k = len(optparams)
# Load the appropriate OA
if k <= 4:
OA = np.load(os.path.join(moduledirectory, 'user_libs', 'OA_9_4_3_2.npy'))
# Number of experiments
N = OA.shape[0]
# Number of columns of OA before cut down
cols = OA.shape[1]
# Cut down OA columns to number of parameters to optimise
OA = OA[:, 0:k]
elif k <= 7:
OA = np.load(os.path.join(moduledirectory, 'user_libs', 'OA_18_7_3_2.npy'))
# Number of experiments
N = OA.shape[0]
# Number of columns of OA before cut down
cols = OA.shape[1]
# Cut down OA columns to number of parameters to optimise
OA = OA[:, 0:k]
else:
p = int(np.ceil(np.log(k * (s - 1) + 1) / np.log(s)))
# Number of experiments

二进制
user_libs/OA_18_7_3_2.npy 普通文件

二进制文件未显示。

二进制
user_libs/OA_9_4_3_2.npy 普通文件

二进制文件未显示。