Refactoring solvers (#541)
* Refactoring solvers * Simplify logic compile * Improve and update doc * Create SupervisedSolverInterface * Specialize SupervisedSolver and ReducedOrderModelSolver * Create EnsembleSolverInterface + EnsembleSupervisedSolver * Create tests ensemble solvers * formatter * codacy * fix issues + speedup test
This commit is contained in:
@@ -30,9 +30,9 @@ class DummyTimeProblem(TimeDependentProblem):
|
||||
|
||||
# define problems
|
||||
problem = Poisson()
|
||||
problem.discretise_domain(50)
|
||||
problem.discretise_domain(10)
|
||||
inverse_problem = InversePoisson()
|
||||
inverse_problem.discretise_domain(50)
|
||||
inverse_problem.discretise_domain(10)
|
||||
|
||||
# reduce the number of data points to speed up testing
|
||||
data_condition = inverse_problem.conditions["data"]
|
||||
@@ -40,9 +40,9 @@ data_condition.input = data_condition.input[:10]
|
||||
data_condition.target = data_condition.target[:10]
|
||||
|
||||
# add input-output condition to test supervised learning
|
||||
input_pts = torch.rand(50, len(problem.input_variables))
|
||||
input_pts = torch.rand(10, len(problem.input_variables))
|
||||
input_pts = LabelTensor(input_pts, problem.input_variables)
|
||||
output_pts = torch.rand(50, len(problem.output_variables))
|
||||
output_pts = torch.rand(10, len(problem.output_variables))
|
||||
output_pts = LabelTensor(output_pts, problem.output_variables)
|
||||
problem.conditions["data"] = Condition(input=input_pts, target=output_pts)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user