Add files via upload

This commit is contained in:
Silviu Marian Udrescu 2020-06-20 19:30:25 -04:00 committed by GitHub
parent 7a0d782d51
commit a96e7f321a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 119 additions and 133 deletions

View file

@ -1,8 +1,6 @@
# Combines 2 pareto fromtier obtained from the separability test into a new one.
from get_pareto import Point, ParetoSet
from RPN_to_pytorch import RPN_to_pytorch
from RPN_to_eq import RPN_to_eq
from S_get_symbolic_expr_error import get_symbolic_expr_error
from sympy.parsing.sympy_parser import parse_expr
import numpy as np
@ -12,7 +10,7 @@ from os import path
from sympy import Symbol, lambdify, N
from get_pareto import Point, ParetoSet
def combine_pareto(pathdir,filename,PA1,PA2,idx_list_1,idx_list_2,PA,sep_type = "+"):
def combine_pareto(input_data,PA1,PA2,idx_list_1,idx_list_2,PA,sep_type = "+"):
possible_vars = ["x%s" %i for i in np.arange(0,30,1)]
PA1 = np.array(PA1.get_pareto_points()).astype('str')
PA2 = np.array(PA2.get_pareto_points()).astype('str')
@ -28,7 +26,7 @@ def combine_pareto(pathdir,filename,PA1,PA2,idx_list_1,idx_list_2,PA,sep_type =
for k in range(len(idx_list_2)-1,-1,-1):
exp2 = exp2.replace(possible_vars[k],possible_vars[idx_list_2[k]])
new_eq = "(" + exp1 + ")" + sep_type + "(" + exp2 + ")"
PA.add(Point(x=complexity,y=get_symbolic_expr_error(pathdir,filename,new_eq),data=new_eq))
PA.add(Point(x=complexity,y=get_symbolic_expr_error(input_data,new_eq),data=new_eq))
except:
continue
return PA