Add files via upload
This commit is contained in:
parent
fe5b8025a2
commit
735e1d43ae
3 changed files with 8 additions and 8 deletions
|
|
@ -18,7 +18,7 @@ from sympy.abc import x,y
|
|||
from sympy.parsing.sympy_parser import parse_expr
|
||||
from sympy import Symbol, lambdify, N
|
||||
|
||||
from S_get_number_DL import get_number_DL
|
||||
from S_get_number_DL_snapped import get_number_DL_snapped
|
||||
|
||||
# parameters: path to data, RPN expression (obtained from bf)
|
||||
def RPN_to_pytorch(data_file, math_expr, lr = 1e-2, N_epochs = 500):
|
||||
|
|
@ -117,7 +117,7 @@ def RPN_to_pytorch(data_file, math_expr, lr = 1e-2, N_epochs = 500):
|
|||
ii = ii + 1
|
||||
else:
|
||||
eq = eq.subs(parm, trainable_parameters[ii])
|
||||
complexity = complexity + get_number_DL(trainable_parameters[ii].detach().numpy())
|
||||
complexity = complexity + get_number_DL_snapped(trainable_parameters[ii].detach().numpy())
|
||||
n_variables = len(eq.free_symbols)
|
||||
n_operations = len(count_ops(eq,visual=True).free_symbols)
|
||||
if n_operations!=0 or n_variables!=0:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue