symbolic-regression/notebook_1.ipynb
Abdalaziz Rashid 6cb3e84e1d Add: notebook
2020-07-15 20:45:53 +03:00

376 lines
34 KiB
Text

{
"cells": [
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [],
"source": [
"import os\n",
"os.chdir(\"Code/\")\n",
"from S_run_aifeynman import run_aifeynman\n"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Checking for brute force + \n",
"\n",
"Checking for brute force * \n",
"\n",
"Checking polyfit \n",
"\n",
"Complexity RMSE Expression\n",
"[0.0, 30.834454019627422, '0']\n",
"[36.83243537730492, 29.126340100893046, cos(x0) + cos(x2 + x3) + 2.333740234375]\n",
"[55.42220420859321, 29.090770779525368, cos(x2 + x3) + 1.88584470748901]\n",
"[63.97127597744305, 28.649814958454087, '1.808310192134*(cos(((x3-x2)/pi)))**(-1)']\n",
"[73.2730466728654, 26.754024113174232, '0.2*x0**2 - 0.444444444444444*x0*x1 + 0.111111111111111*x0 + 0.2*x1**2 + 0.125*x1 + 0.2*x2**2 - 0.444444444444444*x2*x3 + 0.166666666666667*x2 + 0.2*x3**2 + 0.166666666666667*x3 + 0.2']\n",
"Checking for brute force + \n",
"\n",
"Checking for brute force * \n",
"\n",
"Checking polyfit \n",
"\n",
"Complexity RMSE Expression\n",
"[0.0, 30.834454019627422, '0']\n",
"[36.83243537730492, 29.126340100893046, cos(x0) + cos(x2 + x3) + 2.333740234375]\n",
"[46.5605178945111, 27.13368508267342, 1.03779721260071]\n",
"[46.56057652072614, 27.13342063053626, 1.03783938600330]\n",
"[46.560577300542505, 27.13341871851893, 1.03783994698419]\n",
"[73.2730466728654, 26.754024113174232, '0.2*x0**2 - 0.444444444444444*x0*x1 + 0.111111111111111*x0 + 0.2*x1**2 + 0.125*x1 + 0.2*x2**2 - 0.444444444444444*x2*x3 + 0.166666666666667*x2 + 0.2*x3**2 + 0.166666666666667*x3 + 0.2']\n",
"[160.00545553621964, 26.477299826673775, tan(0.110310137271881*cos(exp(cos(x0 - 1.00000607967377*x1))) + 0.792690448036737)]\n",
"Checking for brute force + \n",
"\n",
"Checking for brute force * \n",
"\n",
"Checking polyfit \n",
"\n",
"Complexity RMSE Expression\n",
"[0.0, 30.834454019627422, '0']\n",
"[28.0, 30.771253097071043, 'acos(0.000000000029*(x2/((cos(exp((x2+1))))**(-1)-1)))']\n",
"[31.52932501298081, 30.771253096982818, 'acos(-0.000000000029*(x2/(cos(exp((x2+1)))-1)))']\n",
"[36.83243537730492, 29.126340100893046, cos(x0) + cos(x2 + x3) + 2.333740234375]\n",
"[44.620081767607, 28.75693944878952, -0.270385265350342]\n",
"[46.5605178945111, 27.13368508267342, 1.03779721260071]\n",
"[46.56057652072614, 27.13342063053626, 1.03783938600330]\n",
"[46.560577300542505, 27.13341871851893, 1.03783994698419]\n",
"[73.2730466728654, 26.754024113174232, '0.2*x0**2 - 0.444444444444444*x0*x1 + 0.111111111111111*x0 + 0.2*x1**2 + 0.125*x1 + 0.2*x2**2 - 0.444444444444444*x2*x3 + 0.166666666666667*x2 + 0.2*x3**2 + 0.166666666666667*x3 + 0.2']\n",
"[160.00545553621964, 26.477299826673775, tan(0.110310137271881*cos(exp(cos(x0 - 1.00000607967377*x1))) + 0.792690448036737)]\n",
"Checking for brute force + \n",
"\n",
"Checking for brute force * \n",
"\n",
"Checking polyfit \n",
"\n",
"Complexity RMSE Expression\n",
"[0.0, 30.834454019627422, '0']\n",
"[28.0, 30.771253097071043, 'acos(0.000000000029*(x2/((cos(exp((x2+1))))**(-1)-1)))']\n",
"[31.52932501298081, 30.771253096982818, 'acos(-0.000000000029*(x2/(cos(exp((x2+1)))-1)))']\n",
"[36.83243537730492, 29.126340100893046, cos(x0) + cos(x2 + x3) + 2.333740234375]\n",
"[44.620081767607, 28.75693944878952, -0.270385265350342]\n",
"[46.5605178945111, 27.13368508267342, 1.03779721260071]\n",
"[46.56057652072614, 27.13342063053626, 1.03783938600330]\n",
"[46.560577300542505, 27.13341871851893, 1.03783994698419]\n",
"[73.2730466728654, 26.754024113174232, '0.2*x0**2 - 0.444444444444444*x0*x1 + 0.111111111111111*x0 + 0.2*x1**2 + 0.125*x1 + 0.2*x2**2 - 0.444444444444444*x2*x3 + 0.166666666666667*x2 + 0.2*x3**2 + 0.166666666666667*x3 + 0.2']\n",
"[160.00545553621964, 26.477299826673775, tan(0.110310137271881*cos(exp(cos(x0 - 1.00000607967377*x1))) + 0.792690448036737)]\n",
"Checking for brute force + \n",
"\n",
"Checking for brute force * \n",
"\n",
"Checking polyfit \n",
"\n",
"Complexity RMSE Expression\n",
"[0.0, 30.834454019627422, '0']\n",
"[2.584962500721156, 30.424568966788872, '0.333333333333333']\n",
"[24.799172907404667, 28.116934377305554, 0.739850342273712]\n",
"[45.266642787691886, 27.189710120345147, '1/(1.362559299088+(0+1))']\n",
"[46.5605178945111, 27.13368508267342, 1.03779721260071]\n",
"[46.56057652072614, 27.13342063053626, 1.03783938600330]\n",
"[46.560577300542505, 27.13341871851893, 1.03783994698419]\n",
"[73.2730466728654, 26.754024113174232, '0.2*x0**2 - 0.444444444444444*x0*x1 + 0.111111111111111*x0 + 0.2*x1**2 + 0.125*x1 + 0.2*x2**2 - 0.444444444444444*x2*x3 + 0.166666666666667*x2 + 0.2*x3**2 + 0.166666666666667*x3 + 0.2']\n",
"[160.00545553621964, 26.477299826673775, tan(0.110310137271881*cos(exp(cos(x0 - 1.00000607967377*x1))) + 0.792690448036737)]\n",
"Checking for brute force + \n",
"\n",
"Checking for brute force * \n",
"\n",
"Checking polyfit \n",
"\n",
"Complexity RMSE Expression\n",
"[0.0, 30.834454019627422, '0']\n",
"[1.0, 28.2618719888627, 'exp(0.005979961578*0)']\n",
"[24.799172907404667, 28.116934377305554, 0.739850342273712]\n",
"[45.266642787691886, 27.189710120345147, '1/(1.362559299088+(0+1))']\n",
"[46.5605178945111, 27.13368508267342, 1.03779721260071]\n",
"[46.56057652072614, 27.13342063053626, 1.03783938600330]\n",
"[46.560577300542505, 27.13341871851893, 1.03783994698419]\n",
"[73.2730466728654, 26.754024113174232, '0.2*x0**2 - 0.444444444444444*x0*x1 + 0.111111111111111*x0 + 0.2*x1**2 + 0.125*x1 + 0.2*x2**2 - 0.444444444444444*x2*x3 + 0.166666666666667*x2 + 0.2*x3**2 + 0.166666666666667*x3 + 0.2']\n",
"[160.00545553621964, 26.477299826673775, tan(0.110310137271881*cos(exp(cos(x0 - 1.00000607967377*x1))) + 0.792690448036737)]\n",
"Checking for brute force + \n",
"\n",
"Checking for brute force * \n",
"\n",
"Checking polyfit \n",
"\n",
"Complexity RMSE Expression\n",
"[0.0, 29.11498462062505, 'asin(0.000010935437*0)']\n",
"[1.0, 28.2618719888627, 'exp(0.005979961578*0)']\n",
"[24.799172907404667, 28.116934377305554, 0.739850342273712]\n",
"[45.266642787691886, 27.189710120345147, '1/(1.362559299088+(0+1))']\n",
"[46.5605178945111, 27.13368508267342, 1.03779721260071]\n",
"[46.56057652072614, 27.13342063053626, 1.03783938600330]\n",
"[46.560577300542505, 27.13341871851893, 1.03783994698419]\n",
"[73.2730466728654, 26.754024113174232, '0.2*x0**2 - 0.444444444444444*x0*x1 + 0.111111111111111*x0 + 0.2*x1**2 + 0.125*x1 + 0.2*x2**2 - 0.444444444444444*x2*x3 + 0.166666666666667*x2 + 0.2*x3**2 + 0.166666666666667*x3 + 0.2']\n",
"[160.00545553621964, 26.477299826673775, tan(0.110310137271881*cos(exp(cos(x0 - 1.00000607967377*x1))) + 0.792690448036737)]\n",
"Checking for brute force + \n",
"\n",
"Checking for brute force * \n",
"\n",
"Checking polyfit \n",
"\n",
"Complexity RMSE Expression\n",
"[0.0, 29.11498462062505, 'asin(0.000010935437*0)']\n",
"[1.0, 28.2618719888627, 'exp(0.005979961578*0)']\n",
"[24.799172907404667, 28.116934377305554, 0.739850342273712]\n",
"[45.266642787691886, 27.189710120345147, '1/(1.362559299088+(0+1))']\n",
"[46.5605178945111, 27.13368508267342, 1.03779721260071]\n",
"[46.56057652072614, 27.13342063053626, 1.03783938600330]\n",
"[46.560577300542505, 27.13341871851893, 1.03783994698419]\n",
"[73.2730466728654, 26.754024113174232, '0.2*x0**2 - 0.444444444444444*x0*x1 + 0.111111111111111*x0 + 0.2*x1**2 + 0.125*x1 + 0.2*x2**2 - 0.444444444444444*x2*x3 + 0.166666666666667*x2 + 0.2*x3**2 + 0.166666666666667*x3 + 0.2']\n",
"[160.00545553621964, 26.477299826673775, tan(0.110310137271881*cos(exp(cos(x0 - 1.00000607967377*x1))) + 0.792690448036737)]\n",
"Checking for brute force + \n",
"\n",
"Checking for brute force * \n",
"\n",
"Checking polyfit \n",
"\n",
"Complexity RMSE Expression\n",
"[0.0, 29.11498462062505, 'asin(0.000010935437*0)']\n",
"[1.0, 28.2618719888627, 'exp(0.005979961578*0)']\n",
"[24.799172907404667, 28.116934377305554, 0.739850342273712]\n",
"[45.266642787691886, 27.189710120345147, '1/(1.362559299088+(0+1))']\n",
"[46.5605178945111, 27.13368508267342, 1.03779721260071]\n",
"[46.56057652072614, 27.13342063053626, 1.03783938600330]\n",
"[46.560577300542505, 27.13341871851893, 1.03783994698419]\n",
"[73.2730466728654, 26.754024113174232, '0.2*x0**2 - 0.444444444444444*x0*x1 + 0.111111111111111*x0 + 0.2*x1**2 + 0.125*x1 + 0.2*x2**2 - 0.444444444444444*x2*x3 + 0.166666666666667*x2 + 0.2*x3**2 + 0.166666666666667*x3 + 0.2']\n",
"[160.00545553621964, 26.477299826673775, tan(0.110310137271881*cos(exp(cos(x0 - 1.00000607967377*x1))) + 0.792690448036737)]\n",
"[263.38093407219753, 23.197388789427638, '1.4143588705778813*(0.5017278222224227*x0**2 - x0*x1 + 0.5003427652654595*x1**2 + 0.4991497630565771*x2**2 - x2*x3 + 0.500852962980403*x3**2)**0.5']\n",
"[345.79732842596184, 22.172684609832643, '1.4143588705778813*(0.5017278222224227*x0**2 - x0*x1 - 0.019253275624981383*x0 + 0.5003427652654595*x1**2 + 0.4991497630565771*x2**2 - x2*x3 + 0.500852962980403*x3**2 + 0.03351986083030748)**0.5']\n",
"[425.2261890617839, 22.107491259603417, '1.4143588705778813*(0.5017278222224227*x0**2 - x0*x1 - 0.019253275624981383*x0 + 0.5003427652654595*x1**2 + 0.4991497630565771*x2**2 - x2*x3 + 0.00899392255235808*x2 + 0.500852962980403*x3**2 - 0.009047329955707948*x3 + 0.03351986083030748)**0.5']\n",
"[500.73325993089054, 21.371372655981038, '1.4143588705778813*(0.5017278222224227*x0**2 - x0*x1 + 0.0017369502334144288*x0*x3 - 0.019253275624981383*x0 + 0.5003427652654595*x1**2 - 0.003091048653581563*x1 + 0.4991497630565771*x2**2 - x2*x3 + 0.00899392255235808*x2 + 0.500852962980403*x3**2 - 0.009047329955707948*x3 + 0.03351986083030748)**0.5']\n",
"[583.4121686494021, 21.082997981789408, '1.4143588705778813*(0.5017278222224227*x0**2 - 0.998346232244332*x0*x1 + 0.0017369502334144288*x0*x3 - 0.019253275624981383*x0 + 0.5003427652654595*x1**2 - 0.001550887677953141*x1*x2 - 0.003091048653581563*x1 + 0.4991497630565771*x2**2 - x2*x3 + 0.00899392255235808*x2 + 0.500852962980403*x3**2 - 0.009047329955707948*x3 + 0.03351986083030748)**0.5']\n",
"[617.0709159206434, 20.74528433313743, '1.4143588705778813*(0.5017278222224227*x0**2 - 0.998346232244332*x0*x1 - 0.00013561025890528497*x0*x2 + 0.0017369502334144288*x0*x3 - 0.019253275624981383*x0 + 0.5003427652654595*x1**2 - 0.001550887677953141*x1*x2 - 0.003091048653581563*x1 + 0.4991497630565771*x2**2 - x2*x3 + 0.00899392255235808*x2 + 0.500852962980403*x3**2 - 0.009047329955707948*x3 + 0.03351986083030748)**0.5']\n",
"[648.8545427889388, 20.655611105761754, '1.4143588705778813*(0.5017278222224227*x0**2 - 0.998346232244332*x0*x1 - 0.00013561025890528497*x0*x2 + 0.0017369502334144288*x0*x3 - 0.019253275624981383*x0 + 0.5003427652654595*x1**2 - 0.001550887677953141*x1*x2 - 3.696792363187834e-5*x1*x3 - 0.003091048653581563*x1 + 0.4991497630565771*x2**2 - x2*x3 + 0.00899392255235808*x2 + 0.500852962980403*x3**2 - 0.009047329955707948*x3 + 0.03351986083030748)**0.5']\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Checking for brute force + \n",
"\n",
"Checking for brute force * \n",
"\n",
"Checking polyfit \n",
"\n",
"Complexity RMSE Expression\n",
"[0.0, 29.11498462062505, 'asin(0.000010935437*0)']\n",
"[1.0, 28.2618719888627, 'exp(0.005979961578*0)']\n",
"[24.799172907404667, 28.116934377305554, 0.739850342273712]\n",
"[45.266642787691886, 27.189710120345147, '1/(1.362559299088+(0+1))']\n",
"[46.5605178945111, 27.13368508267342, 1.03779721260071]\n",
"[46.56057652072614, 27.13342063053626, 1.03783938600330]\n",
"[46.560577300542505, 27.13341871851893, 1.03783994698419]\n",
"[73.2730466728654, 26.754024113174232, '0.2*x0**2 - 0.444444444444444*x0*x1 + 0.111111111111111*x0 + 0.2*x1**2 + 0.125*x1 + 0.2*x2**2 - 0.444444444444444*x2*x3 + 0.166666666666667*x2 + 0.2*x3**2 + 0.166666666666667*x3 + 0.2']\n",
"[160.00545553621964, 26.477299826673775, tan(0.110310137271881*cos(exp(cos(x0 - 1.00000607967377*x1))) + 0.792690448036737)]\n",
"[263.38093407219753, 23.197388789427638, '1.4143588705778813*(0.5017278222224227*x0**2 - x0*x1 + 0.5003427652654595*x1**2 + 0.4991497630565771*x2**2 - x2*x3 + 0.500852962980403*x3**2)**0.5']\n",
"[345.79732842596184, 22.172684609832643, '1.4143588705778813*(0.5017278222224227*x0**2 - x0*x1 - 0.019253275624981383*x0 + 0.5003427652654595*x1**2 + 0.4991497630565771*x2**2 - x2*x3 + 0.500852962980403*x3**2 + 0.03351986083030748)**0.5']\n",
"[425.2261890617839, 22.107491259603417, '1.4143588705778813*(0.5017278222224227*x0**2 - x0*x1 - 0.019253275624981383*x0 + 0.5003427652654595*x1**2 + 0.4991497630565771*x2**2 - x2*x3 + 0.00899392255235808*x2 + 0.500852962980403*x3**2 - 0.009047329955707948*x3 + 0.03351986083030748)**0.5']\n",
"[500.73325993089054, 21.371372655981038, '1.4143588705778813*(0.5017278222224227*x0**2 - x0*x1 + 0.0017369502334144288*x0*x3 - 0.019253275624981383*x0 + 0.5003427652654595*x1**2 - 0.003091048653581563*x1 + 0.4991497630565771*x2**2 - x2*x3 + 0.00899392255235808*x2 + 0.500852962980403*x3**2 - 0.009047329955707948*x3 + 0.03351986083030748)**0.5']\n",
"[583.4121686494021, 21.082997981789408, '1.4143588705778813*(0.5017278222224227*x0**2 - 0.998346232244332*x0*x1 + 0.0017369502334144288*x0*x3 - 0.019253275624981383*x0 + 0.5003427652654595*x1**2 - 0.001550887677953141*x1*x2 - 0.003091048653581563*x1 + 0.4991497630565771*x2**2 - x2*x3 + 0.00899392255235808*x2 + 0.500852962980403*x3**2 - 0.009047329955707948*x3 + 0.03351986083030748)**0.5']\n",
"[617.0709159206434, 20.74528433313743, '1.4143588705778813*(0.5017278222224227*x0**2 - 0.998346232244332*x0*x1 - 0.00013561025890528497*x0*x2 + 0.0017369502334144288*x0*x3 - 0.019253275624981383*x0 + 0.5003427652654595*x1**2 - 0.001550887677953141*x1*x2 - 0.003091048653581563*x1 + 0.4991497630565771*x2**2 - x2*x3 + 0.00899392255235808*x2 + 0.500852962980403*x3**2 - 0.009047329955707948*x3 + 0.03351986083030748)**0.5']\n",
"[648.8545427889388, 20.655611105761754, '1.4143588705778813*(0.5017278222224227*x0**2 - 0.998346232244332*x0*x1 - 0.00013561025890528497*x0*x2 + 0.0017369502334144288*x0*x3 - 0.019253275624981383*x0 + 0.5003427652654595*x1**2 - 0.001550887677953141*x1*x2 - 3.696792363187834e-5*x1*x3 - 0.003091048653581563*x1 + 0.4991497630565771*x2**2 - x2*x3 + 0.00899392255235808*x2 + 0.500852962980403*x3**2 - 0.009047329955707948*x3 + 0.03351986083030748)**0.5']\n",
"Checking for symmetry \n",
" example1.txt_train\n",
"NN already trained \n",
"\n",
"NN loss: tensor(0.0054, device='cuda:0', grad_fn=<DivBackward0>) \n",
"\n",
"Checking for brute force + \n",
"\n",
"Checking for brute force * \n",
"\n",
"Checking polyfit \n",
"\n",
"Complexity RMSE Expression\n",
"[41.00746161452253, 30.09085193552534, '0.005526065149+x0']\n",
"[46.51562058933622, 29.655673181137093, '1.005997877242+0']\n",
"[47.56306903495083, 29.20122085911535, 2.07926797866821]\n",
"[47.56309982186975, 29.201196353322274, 2.07931235044180]\n",
"[53.788821841164236, 27.62398126319099, '0.2*x0**2 - 0.444444444444444*x0*x1 + 0.111111111111111*x0 + 0.2*x1**2 + 0.111111111111111*x1 + 0.2*x2**2 + 0.625']\n",
"[134.9914536392488, 27.477494428613465, '0.2*x0**2 - 0.444444444444444*x0*x1 + 0.111111111111111*x0 + 0.2*x1**2 + 0.111111111111111*x1 + 0.215954831506173*x2**2 + 0.618452302296974']\n",
"[174.2336407187873, 27.411232030672878, '0.2*x0**2 - 0.444444444444444*x0*x1 + 0.117043664748058*x0 + 0.2*x1**2 + 0.111111111111111*x1 + 0.215954831506173*x2**2 + 0.618452302296974']\n",
"[213.45760424483618, 27.361096592620452, '0.2*x0**2 - 0.444444444444444*x0*x1 + 0.117043664748058*x0 + 0.2*x1**2 + 0.115574513841056*x1 + 0.215954831506173*x2**2 + 0.618452302296974']\n",
"[253.29772029287489, 27.31091692945235, '0.2*x0**2 - 0.442876335504526*x0*x1 + 0.117043664748058*x0 + 0.2*x1**2 + 0.115574513841056*x1 + 0.215954831506173*x2**2 + 0.618452302296974']\n",
"[294.18400204664965, 27.18257406153149, '0.2*x0**2 - 0.442876335504526*x0*x1 + 0.117043664748058*x0 + 0.203234399705988*x1**2 + 0.115574513841056*x1 + 0.215954831506173*x2**2 + 0.618452302296974']\n",
"[335.06346139834125, 27.09312365222236, '0.202275587570397*x0**2 - 0.442876335504526*x0*x1 + 0.117043664748058*x0 + 0.203234399705988*x1**2 + 0.115574513841056*x1 + 0.215954831506173*x2**2 + 0.618452302296974']\n",
"[372.9763469058657, 27.09288279505926, '0.202275587570397*x0**2 - 0.442876335504526*x0*x1 + 0.117043664748058*x0 + 0.203234399705988*x1**2 + 0.115574513841056*x1 + 0.215954831506173*x2**2 - 0.00258771092841753*x2 + 0.618452302296974']\n",
"Checking for brute force + \n",
"\n",
"Checking for brute force * \n",
"\n",
"Checking polyfit \n",
"\n",
"Complexity RMSE Expression\n",
"[26.416665599935456, 31.1518315940849, '-tan(0.1*x0*x1 - 0.625)']\n",
"[40.393057897115405, 29.96077714329656, 'tan(-3.127155157913+pi)']\n",
"[46.0166311684591, 29.95909299612648, '0.711846380458438']\n",
"[46.51562058933622, 29.655673181137093, '1.005997877242+0']\n",
"[46.56048485312749, 27.13374549663888, 1.03777344467875]\n",
"[46.5605178945111, 27.13368508267342, 1.03779721260071]\n",
"[46.56057652072614, 27.13342063053626, 1.03783938600330]\n",
"[46.560577300542505, 27.13341871851893, 1.03783994698419]\n",
"[102.67167768852295, 26.541444652379788, tan(0.90005761384964*cos(0.287166885245334*exp(cos(x2))))]\n",
"Checking for brute force + \n",
"\n",
"Checking for brute force * \n",
"\n",
"Checking polyfit \n",
"\n",
"Complexity RMSE Expression\n",
"[0.0, 30.834454019627422, '0']\n",
"[13.60964047443681, 30.637772416392103, 'acos(0.000000000012*(x0+exp(exp(pi))))']\n",
"[40.393057897115405, 29.96077714329656, 'tan(-3.127155157913+pi)']\n",
"[44.620081767607, 28.75693944878952, -0.270385265350342]\n",
"[46.56048485312749, 27.13374549663888, 1.03777344467875]\n",
"[46.5605178945111, 27.13368508267342, 1.03779721260071]\n",
"[46.56057652072614, 27.13342063053626, 1.03783938600330]\n",
"[46.560577300542505, 27.13341871851893, 1.03783994698419]\n",
"[102.67167768852295, 26.541444652379788, tan(0.90005761384964*cos(0.287166885245334*exp(cos(x2))))]\n",
"Checking for brute force + \n",
"\n",
"Checking for brute force * \n",
"\n",
"Checking polyfit \n",
"\n",
"Complexity RMSE Expression\n",
"[0.0, 30.834454019627422, '0']\n",
"[13.60964047443681, 30.637772416392103, 'acos(0.000000000012*(x0+exp(exp(pi))))']\n",
"[39.56224242422107, 27.059894559359066, 'log(3*x0**2 - 6*x0*x1 - x0 + 3*x1**2 - x1 + 3*x2**2)']\n",
"[102.67167768852295, 26.541444652379788, tan(0.90005761384964*cos(0.287166885245334*exp(cos(x2))))]\n",
"Checking for brute force + \n",
"\n",
"Checking for brute force * \n",
"\n",
"Checking polyfit \n",
"\n",
"Complexity RMSE Expression\n",
"[0.0, 30.834454019627422, '0']\n",
"[2.0, 30.21233279612709, '0.500000000000000']\n",
"[32.00876552846736, 28.13821400441772, '1/(-0.934925954011+x1)']\n",
"[39.56224242422107, 27.059894559359066, 'log(3*x0**2 - 6*x0*x1 - x0 + 3*x1**2 - x1 + 3*x2**2)']\n",
"[102.67167768852295, 26.541444652379788, tan(0.90005761384964*cos(0.287166885245334*exp(cos(x2))))]\n",
"Checking for brute force + \n",
"\n",
"Checking for brute force * \n",
"\n",
"Checking polyfit \n",
"\n",
"Complexity RMSE Expression\n",
"[0.0, 30.834454019627422, '0']\n",
"[2.0, 30.21233279612709, '0.500000000000000']\n",
"[26.736183635149136, 28.02326246238811, exp(-0.119926199316978*exp(exp(cos(x2))))]\n",
"[39.56224242422107, 27.059894559359066, 'log(3*x0**2 - 6*x0*x1 - x0 + 3*x1**2 - x1 + 3*x2**2)']\n",
"[102.67167768852295, 26.541444652379788, tan(0.90005761384964*cos(0.287166885245334*exp(cos(x2))))]\n",
"Checking for brute force + \n",
"\n",
"Checking for brute force * \n",
"\n",
"Checking polyfit \n",
"\n",
"Complexity RMSE Expression\n",
"[0.0, 30.834454019627422, '0']\n",
"[2.0, 30.21233279612709, '0.500000000000000']\n",
"[26.736183635149136, 28.02326246238811, exp(-0.119926199316978*exp(exp(cos(x2))))]\n",
"[39.56224242422107, 27.059894559359066, 'log(3*x0**2 - 6*x0*x1 - x0 + 3*x1**2 - x1 + 3*x2**2)']\n",
"[102.67167768852295, 26.541444652379788, tan(0.90005761384964*cos(0.287166885245334*exp(cos(x2))))]\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Checking for brute force + \n",
"\n",
"Checking for brute force * \n",
"\n",
"Checking polyfit \n",
"\n",
"Complexity RMSE Expression\n",
"[0.0, 30.834454019627422, '0']\n",
"[2.0, 30.21233279612709, '0.500000000000000']\n",
"[26.736183635149136, 28.02326246238811, exp(-0.119926199316978*exp(exp(cos(x2))))]\n",
"[39.56224242422107, 27.059894559359066, 'log(3*x0**2 - 6*x0*x1 - x0 + 3*x1**2 - x1 + 3*x2**2)']\n",
"[102.67167768852295, 26.541444652379788, tan(0.90005761384964*cos(0.287166885245334*exp(cos(x2))))]\n"
]
},
{
"ename": "OSError",
"evalue": "results/translated_data_minus/example1.txt_train-translated_minus not found.",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mOSError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<timed eval>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n",
"\u001b[0;32m~/lambda_lab/AI-Feynman/Code/S_run_aifeynman.py\u001b[0m in \u001b[0;36mrun_aifeynman\u001b[0;34m(pathdir, filename, BF_try_time, BF_ops_file_type, polyfit_deg, NN_epochs, vars_name, test_percentage)\u001b[0m\n\u001b[1;32m 163\u001b[0m \u001b[0mPA\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mParetoSet\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 164\u001b[0m \u001b[0;31m# Run the code on the train data\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 165\u001b[0;31m \u001b[0mPA\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mrun_AI_all\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mpathdir\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mfilename\u001b[0m\u001b[0;34m+\u001b[0m\u001b[0;34m\"_train\"\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mBF_try_time\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mBF_ops_file_type\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mpolyfit_deg\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mNN_epochs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mPA\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mPA\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 166\u001b[0m \u001b[0mPA_list\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mPA\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget_pareto_points\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 167\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m~/lambda_lab/AI-Feynman/Code/S_run_aifeynman.py\u001b[0m in \u001b[0;36mrun_AI_all\u001b[0;34m(pathdir, filename, BF_try_time, BF_ops_file_type, polyfit_deg, NN_epochs, PA)\u001b[0m\n\u001b[1;32m 96\u001b[0m \u001b[0mnew_pathdir\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mnew_filename\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mdo_translational_symmetry_minus\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mpathdir\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mfilename\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0msymmetry_minus_result\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0msymmetry_minus_result\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m2\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 97\u001b[0m \u001b[0mPA1_\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mParetoSet\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 98\u001b[0;31m \u001b[0mPA1\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mrun_AI_all\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mnew_pathdir\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mnew_filename\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mBF_try_time\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mBF_ops_file_type\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mpolyfit_deg\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mNN_epochs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mPA1_\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 99\u001b[0m \u001b[0mPA\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0madd_sym_on_pareto\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mpathdir\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mfilename\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mPA1\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0msymmetry_minus_result\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0msymmetry_minus_result\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m2\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mPA\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\"-\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 100\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mPA\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m~/lambda_lab/AI-Feynman/Code/S_run_aifeynman.py\u001b[0m in \u001b[0;36mrun_AI_all\u001b[0;34m(pathdir, filename, BF_try_time, BF_ops_file_type, polyfit_deg, NN_epochs, PA)\u001b[0m\n\u001b[1;32m 47\u001b[0m \u001b[0mPA\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mget_sin\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mpathdir\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\"results/mystery_world_sin/\"\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mfilename\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mBF_try_time\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mBF_ops_file_type\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mPA\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mpolyfit_deg\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 48\u001b[0m \u001b[0mPA\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mget_sqrt\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mpathdir\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\"results/mystery_world_sqrt/\"\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mfilename\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mBF_try_time\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mBF_ops_file_type\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mPA\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mpolyfit_deg\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 49\u001b[0;31m \u001b[0mPA\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mget_squared\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mpathdir\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\"results/mystery_world_squared/\"\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mfilename\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mBF_try_time\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mBF_ops_file_type\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mPA\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mpolyfit_deg\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 50\u001b[0m \u001b[0mPA\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mget_tan\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mpathdir\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\"results/mystery_world_tan/\"\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mfilename\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mBF_try_time\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mBF_ops_file_type\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mPA\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mpolyfit_deg\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 51\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m~/lambda_lab/AI-Feynman/Code/S_change_output.py\u001b[0m in \u001b[0;36mget_squared\u001b[0;34m(pathdir, pathdir_write_to, filename, BF_try_time, BF_ops_file_type, PA, polyfit_deg)\u001b[0m\n\u001b[1;32m 151\u001b[0m \u001b[0;32mexcept\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 152\u001b[0m \u001b[0;32mpass\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 153\u001b[0;31m \u001b[0mdata\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mloadtxt\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mpathdir\u001b[0m\u001b[0;34m+\u001b[0m\u001b[0mfilename\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 154\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 155\u001b[0m \u001b[0mdata\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m-\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mdata\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m-\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m**\u001b[0m\u001b[0;36m2\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m~/.local/lib/python3.8/site-packages/numpy/lib/npyio.py\u001b[0m in \u001b[0;36mloadtxt\u001b[0;34m(fname, dtype, comments, delimiter, converters, skiprows, usecols, unpack, ndmin, encoding, max_rows)\u001b[0m\n\u001b[1;32m 979\u001b[0m \u001b[0mfname\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mos_fspath\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfname\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 980\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0m_is_string_like\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfname\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 981\u001b[0;31m \u001b[0mfh\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mlib\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_datasource\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mopen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfname\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m'rt'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mencoding\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mencoding\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 982\u001b[0m \u001b[0mfencoding\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mgetattr\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfh\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m'encoding'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m'latin1'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 983\u001b[0m \u001b[0mfh\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0miter\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfh\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m~/.local/lib/python3.8/site-packages/numpy/lib/_datasource.py\u001b[0m in \u001b[0;36mopen\u001b[0;34m(path, mode, destpath, encoding, newline)\u001b[0m\n\u001b[1;32m 267\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 268\u001b[0m \u001b[0mds\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mDataSource\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mdestpath\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 269\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mds\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mopen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mpath\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmode\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mencoding\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mencoding\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mnewline\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mnewline\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 270\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 271\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m~/.local/lib/python3.8/site-packages/numpy/lib/_datasource.py\u001b[0m in \u001b[0;36mopen\u001b[0;34m(self, path, mode, encoding, newline)\u001b[0m\n\u001b[1;32m 621\u001b[0m encoding=encoding, newline=newline)\n\u001b[1;32m 622\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 623\u001b[0;31m \u001b[0;32mraise\u001b[0m \u001b[0mIOError\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"%s not found.\"\u001b[0m \u001b[0;34m%\u001b[0m \u001b[0mpath\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 624\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 625\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mOSError\u001b[0m: results/translated_data_minus/example1.txt_train-translated_minus not found."
]
}
],
"source": [
"%%time\n",
"run_aifeynman(\"../example_data/\",\"example1.txt\",30,\"14ops.txt\", polyfit_deg=3, NN_epochs=400)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.3"
}
},
"nbformat": 4,
"nbformat_minor": 4
}