diff --git a/notebook_1.ipynb b/notebook_1.ipynb index 638359f..948248d 100644 --- a/notebook_1.ipynb +++ b/notebook_1.ipynb @@ -1,376 +1,803 @@ { - "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" - ] + "nbformat": 4, + "nbformat_minor": 0, + "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" + }, + "colab": { + "name": "notebook_1.ipynb", + "provenance": [] + }, + "accelerator": "GPU" }, - { - "cell_type": "code", - "execution_count": 12, - "metadata": {}, - "outputs": [ + "cells": [ { - "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" - ] + "cell_type": "code", + "metadata": { + "id": "LNzvcQYRncpd", + "colab_type": "code", + "colab": { + "base_uri": "https://localhost:8080/", + "height": 136 + }, + "outputId": "78e21a20-6b45-46f5-bb3e-c99858e33a80" + }, + "source": [ + "!git clone https://github.com/abdalazizrashid/AI-Feynman.git" + ], + "execution_count": 3, + "outputs": [ + { + "output_type": "stream", + "text": [ + "Cloning into 'AI-Feynman'...\n", + "remote: Enumerating objects: 34, done.\u001b[K\n", + "remote: Counting objects: 100% (34/34), done.\u001b[K\n", + "remote: Compressing objects: 100% (20/20), done.\u001b[K\n", + "remote: Total 436 (delta 15), reused 29 (delta 13), pack-reused 402\u001b[K\n", + "Receiving objects: 100% (436/436), 31.29 MiB | 21.55 MiB/s, done.\n", + "Resolving deltas: 100% (263/263), done.\n" + ], + "name": "stdout" + } + ] }, { - "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=) \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" - ] + "cell_type": "code", + "metadata": { + "id": "wY7fcIORnmzR", + "colab_type": "code", + "colab": { + "base_uri": "https://localhost:8080/", + "height": 289 + }, + "outputId": "071a2d56-f9b7-4a6e-f026-176467e727a6" + }, + "source": [ + "!pip install -r AI-Feynman/requirements.txt" + ], + "execution_count": 4, + "outputs": [ + { + "output_type": "stream", + "text": [ + "Requirement already satisfied: torch in /usr/local/lib/python3.6/dist-packages (from -r AI-Feynman/requirements.txt (line 1)) (1.5.1+cu101)\n", + "Requirement already satisfied: numpy in /usr/local/lib/python3.6/dist-packages (from -r AI-Feynman/requirements.txt (line 2)) (1.18.5)\n", + "Requirement already satisfied: matplotlib in /usr/local/lib/python3.6/dist-packages (from -r AI-Feynman/requirements.txt (line 3)) (3.2.2)\n", + "Requirement already satisfied: sympy in /usr/local/lib/python3.6/dist-packages (from -r AI-Feynman/requirements.txt (line 4)) (1.1.1)\n", + "Requirement already satisfied: pandas in /usr/local/lib/python3.6/dist-packages (from -r AI-Feynman/requirements.txt (line 5)) (1.0.5)\n", + "Requirement already satisfied: scipy in /usr/local/lib/python3.6/dist-packages (from -r AI-Feynman/requirements.txt (line 6)) (1.4.1)\n", + "Requirement already satisfied: sortedcontainers in /usr/local/lib/python3.6/dist-packages (from -r AI-Feynman/requirements.txt (line 7)) (2.2.2)\n", + "Requirement already satisfied: tabulate in /usr/local/lib/python3.6/dist-packages (from -r AI-Feynman/requirements.txt (line 8)) (0.8.7)\n", + "Requirement already satisfied: future in /usr/local/lib/python3.6/dist-packages (from torch->-r AI-Feynman/requirements.txt (line 1)) (0.16.0)\n", + "Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.6/dist-packages (from matplotlib->-r AI-Feynman/requirements.txt (line 3)) (0.10.0)\n", + "Requirement already satisfied: kiwisolver>=1.0.1 in /usr/local/lib/python3.6/dist-packages (from matplotlib->-r AI-Feynman/requirements.txt (line 3)) (1.2.0)\n", + "Requirement already satisfied: python-dateutil>=2.1 in /usr/local/lib/python3.6/dist-packages (from matplotlib->-r AI-Feynman/requirements.txt (line 3)) (2.8.1)\n", + "Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in /usr/local/lib/python3.6/dist-packages (from matplotlib->-r AI-Feynman/requirements.txt (line 3)) (2.4.7)\n", + "Requirement already satisfied: mpmath>=0.19 in /usr/local/lib/python3.6/dist-packages (from sympy->-r AI-Feynman/requirements.txt (line 4)) (1.1.0)\n", + "Requirement already satisfied: pytz>=2017.2 in /usr/local/lib/python3.6/dist-packages (from pandas->-r AI-Feynman/requirements.txt (line 5)) (2018.9)\n", + "Requirement already satisfied: six in /usr/local/lib/python3.6/dist-packages (from cycler>=0.10->matplotlib->-r AI-Feynman/requirements.txt (line 3)) (1.12.0)\n" + ], + "name": "stdout" + } + ] }, { - "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" - ] + "cell_type": "code", + "metadata": { + "id": "Y0gbIW5HnuQl", + "colab_type": "code", + "colab": {} + }, + "source": [ + "!cd /content/AI-Feynman/Code/ && ./compile.sh" + ], + "execution_count": 6, + "outputs": [] }, { - "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\u001b[0m in \u001b[0;36m\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." - ] + "cell_type": "code", + "metadata": { + "id": "Kf05DiVfn1H9", + "colab_type": "code", + "colab": { + "base_uri": "https://localhost:8080/", + "height": 34 + }, + "outputId": "6aabba4d-ba86-4025-bf52-97aaab3d87fe" + }, + "source": [ + "import os\n", + "os.chdir(\"/content/AI-Feynman/Code/\")\n", + "print(os.getcwd())" + ], + "execution_count": 7, + "outputs": [ + { + "output_type": "stream", + "text": [ + "/content/AI-Feynman/Code\n" + ], + "name": "stdout" + } + ] + }, + { + "cell_type": "code", + "metadata": { + "id": "FuenJ6qWnSa9", + "colab_type": "code", + "colab": {} + }, + "source": [ + "from S_run_aifeynman import run_aifeynman\n" + ], + "execution_count": 8, + "outputs": [] + }, + { + "cell_type": "code", + "metadata": { + "id": "rxKF50gnnSbE", + "colab_type": "code", + "colab": { + "base_uri": "https://localhost:8080/", + "height": 1000 + }, + "outputId": "66121f32-cddf-4609-df6e-9be120d0e8e7" + }, + "source": [ + "%%time\n", + "run_aifeynman(\"../example_data/\",\"example1.txt\",30,\"14ops.txt\", polyfit_deg=3, NN_epochs=400)" + ], + "execution_count": 9, + "outputs": [ + { + "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.834454019627426, '0']\n", + "[36.83243537730492, 29.12634010089305, cos(x0) + cos(x2 + x3) + 2.333740234375]\n", + "[55.42220420859321, 29.09077077952536, cos(x2 + x3) + 1.88584470748901]\n", + "[63.97127597744305, 28.649814958454094, '1.808310192134*(cos(((x3-x2)/pi)))**(-1)']\n", + "[73.2730466728654, 26.754024113174246, '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.834454019627426, '0']\n", + "[36.83243537730492, 29.12634010089305, cos(x0) + cos(x2 + x3) + 2.333740234375]\n", + "[46.5605178945111, 27.13368508267342, 1.03779721260071]\n", + "[46.56056711257602, 27.133459108345154, 1.03783261803319]\n", + "[46.56057649641146, 27.13342067603215, 1.03783936851191]\n", + "[46.560576570214884, 27.133420535207133, 1.03783942160429]\n", + "[48.48784302438703, 26.85871313046377, 'tan(0.036548656722*exp(pi))']\n", + "[48.613819620546025, 26.858713124630636, 'tan(0.269214177330*pi)']\n", + "[73.2730466728654, 26.754024113174246, '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", + "[206.23011212397856, 26.70884811651698, tan(0.694796025753021*log(-0.642380475997925*cos(x2 - 1.00466322898865*x3) + 3.26658010482788))]\n", + "Checking for brute force + \n", + "\n", + "Checking for brute force * \n", + "\n", + "Checking polyfit \n", + "\n", + "Complexity RMSE Expression\n", + "[0.0, 30.834454019627426, '0']\n", + "[36.83243537730492, 29.12634010089305, cos(x0) + cos(x2 + x3) + 2.333740234375]\n", + "[44.620081767607, 28.75693944878952, -0.270385265350342]\n", + "[46.5605178945111, 27.13368508267342, 1.03779721260071]\n", + "[46.56056711257602, 27.133459108345154, 1.03783261803319]\n", + "[46.56057649641146, 27.13342067603215, 1.03783936851191]\n", + "[46.560576570214884, 27.133420535207133, 1.03783942160429]\n", + "[48.48784302438703, 26.85871313046377, 'tan(0.036548656722*exp(pi))']\n", + "[48.613819620546025, 26.858713124630636, 'tan(0.269214177330*pi)']\n", + "[73.2730466728654, 26.754024113174246, '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", + "[206.23011212397856, 26.70884811651698, tan(0.694796025753021*log(-0.642380475997925*cos(x2 - 1.00466322898865*x3) + 3.26658010482788))]\n", + "Checking for brute force + \n", + "\n", + "Checking for brute force * \n", + "\n", + "Checking polyfit \n", + "\n", + "Complexity RMSE Expression\n", + "[0.0, 30.834454019627426, '0']\n", + "[36.83243537730492, 29.12634010089305, cos(x0) + cos(x2 + x3) + 2.333740234375]\n", + "[44.620081767607, 28.75693944878952, -0.270385265350342]\n", + "[46.5605178945111, 27.13368508267342, 1.03779721260071]\n", + "[46.56056711257602, 27.133459108345154, 1.03783261803319]\n", + "[46.56057649641146, 27.13342067603215, 1.03783936851191]\n", + "[46.560576570214884, 27.133420535207133, 1.03783942160429]\n", + "[48.48784302438703, 26.85871313046377, 'tan(0.036548656722*exp(pi))']\n", + "[48.613819620546025, 26.858713124630636, 'tan(0.269214177330*pi)']\n", + "[73.2730466728654, 26.754024113174246, '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", + "[206.23011212397856, 26.70884811651698, tan(0.694796025753021*log(-0.642380475997925*cos(x2 - 1.00466322898865*x3) + 3.26658010482788))]\n", + "Checking for brute force + \n", + "\n", + "Checking for brute force * \n", + "\n", + "Checking polyfit \n", + "\n", + "Complexity RMSE Expression\n", + "[0.0, 30.834454019627426, '0']\n", + "[2.584962500721156, 30.42456896678888, '0.333333333333333']\n", + "[32.00876552846736, 28.13821400441772, '1/(-0.934925954011+x1)']\n", + "[46.070972708611805, 28.114455148352643, 0.739170650917556]\n", + "[46.5605178945111, 27.13368508267342, 1.03779721260071]\n", + "[46.56056711257602, 27.133459108345154, 1.03783261803319]\n", + "[46.56057649641146, 27.13342067603215, 1.03783936851191]\n", + "[46.560576570214884, 27.133420535207133, 1.03783942160429]\n", + "[48.48784302438703, 26.85871313046377, 'tan(0.036548656722*exp(pi))']\n", + "[48.613819620546025, 26.858713124630636, 'tan(0.269214177330*pi)']\n", + "[73.2730466728654, 26.754024113174246, '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", + "[206.23011212397856, 26.70884811651698, tan(0.694796025753021*log(-0.642380475997925*cos(x2 - 1.00466322898865*x3) + 3.26658010482788))]\n", + "Checking for brute force + \n", + "\n", + "Checking for brute force * \n", + "\n", + "Checking polyfit \n", + "\n", + "Complexity RMSE Expression\n", + "[0.0, 30.834454019627426, '0']\n", + "[2.584962500721156, 30.42456896678888, '0.333333333333333']\n", + "[28.865610660795387, 29.201384954099407, -4.89119133556296e-6]\n", + "[32.00876552846736, 28.13821400441772, '1/(-0.934925954011+x1)']\n", + "[46.070972708611805, 28.114455148352643, 0.739170650917556]\n", + "[46.5605178945111, 27.13368508267342, 1.03779721260071]\n", + "[46.56056711257602, 27.133459108345154, 1.03783261803319]\n", + "[46.56057649641146, 27.13342067603215, 1.03783936851191]\n", + "[46.560576570214884, 27.133420535207133, 1.03783942160429]\n", + "[48.48784302438703, 26.85871313046377, 'tan(0.036548656722*exp(pi))']\n", + "[48.613819620546025, 26.858713124630636, 'tan(0.269214177330*pi)']\n", + "[73.2730466728654, 26.754024113174246, '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", + "[206.23011212397856, 26.70884811651698, tan(0.694796025753021*log(-0.642380475997925*cos(x2 - 1.00466322898865*x3) + 3.26658010482788))]\n", + "Checking for brute force + \n", + "\n", + "Checking for brute force * \n", + "\n", + "Checking polyfit \n", + "\n", + "Complexity RMSE Expression\n", + "[0.0, 30.834454019627426, '0']\n", + "[2.584962500721156, 30.42456896678888, '0.333333333333333']\n", + "[28.865610660795387, 29.201384954099407, -4.89119133556296e-6]\n", + "[28.88485156251213, 29.114959286627403, 'asin(-0.000004956861+(x1*sin(pi)))']\n", + "[29.02302728370149, 29.114941148276046, 'asin(-3.141598108678+pi)']\n", + "[32.00876552846736, 28.13821400441772, '1/(-0.934925954011+x1)']\n", + "[46.070972708611805, 28.114455148352643, 0.739170650917556]\n", + "[46.5605178945111, 27.13368508267342, 1.03779721260071]\n", + "[46.56056711257602, 27.133459108345154, 1.03783261803319]\n", + "[46.56057649641146, 27.13342067603215, 1.03783936851191]\n", + "[46.560576570214884, 27.133420535207133, 1.03783942160429]\n", + "[48.48784302438703, 26.85871313046377, 'tan(0.036548656722*exp(pi))']\n", + "[48.613819620546025, 26.858713124630636, 'tan(0.269214177330*pi)']\n", + "[73.2730466728654, 26.754024113174246, '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", + "[206.23011212397856, 26.70884811651698, tan(0.694796025753021*log(-0.642380475997925*cos(x2 - 1.00466322898865*x3) + 3.26658010482788))]\n", + "Checking for brute force + \n", + "\n", + "Checking for brute force * \n", + "\n", + "Checking polyfit \n", + "\n", + "Complexity RMSE Expression\n", + "[0.0, 30.834454019627426, '0']\n", + "[2.584962500721156, 30.42456896678888, '0.333333333333333']\n", + "[28.865610660795387, 29.201384954099407, -4.89119133556296e-6]\n", + "[28.88485156251213, 29.114959286627403, 'asin(-0.000004956861+(x1*sin(pi)))']\n", + "[29.02302728370149, 29.114941148276046, 'asin(-3.141598108678+pi)']\n", + "[32.00876552846736, 28.13821400441772, '1/(-0.934925954011+x1)']\n", + "[46.070972708611805, 28.114455148352643, 0.739170650917556]\n", + "[46.5605178945111, 27.13368508267342, 1.03779721260071]\n", + "[46.56056711257602, 27.133459108345154, 1.03783261803319]\n", + "[46.56057649641146, 27.13342067603215, 1.03783936851191]\n", + "[46.560576570214884, 27.133420535207133, 1.03783942160429]\n", + "[48.48784302438703, 26.85871313046377, 'tan(0.036548656722*exp(pi))']\n", + "[48.613819620546025, 26.858713124630636, 'tan(0.269214177330*pi)']\n", + "[73.2730466728654, 26.754024113174246, '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", + "[206.23011212397856, 26.70884811651698, tan(0.694796025753021*log(-0.642380475997925*cos(x2 - 1.00466322898865*x3) + 3.26658010482788))]\n", + "Checking for brute force + \n", + "\n", + "Checking for brute force * \n", + "\n", + "Checking polyfit \n", + "\n", + "Complexity RMSE Expression\n", + "[0.0, 30.834454019627426, '0']\n", + "[1.0, 29.661717905473818, '1']\n", + "[28.865610660795387, 29.201384954099407, -4.89119133556296e-6]\n", + "[28.88485156251213, 29.114959286627403, 'asin(-0.000004956861+(x1*sin(pi)))']\n", + "[29.02302728370149, 29.114941148276046, 'asin(-3.141598108678+pi)']\n", + "[32.00876552846736, 28.13821400441772, '1/(-0.934925954011+x1)']\n", + "[35.50977500432694, 1.6280023074285465e-06, '(x0**2 - 2*x0*x1 + x1**2 + x2**2 - 2*x2*x3 + x3**2)**0.5']\n", + "Checking for brute force + \n", + "\n", + "Checking for brute force * \n", + "\n", + "Checking polyfit \n", + "\n", + "Complexity RMSE Expression\n", + "[0.0, 30.834454019627426, '0']\n", + "[1.0, 29.661717905473818, '1']\n", + "[28.865610660795387, 29.201384954099407, -4.89119133556296e-6]\n", + "[28.88485156251213, 29.114959286627403, 'asin(-0.000004956861+(x1*sin(pi)))']\n", + "[29.02302728370149, 29.114941148276046, 'asin(-3.141598108678+pi)']\n", + "[32.00876552846736, 28.13821400441772, '1/(-0.934925954011+x1)']\n", + "[35.50977500432694, 1.6280023074285465e-06, '(x0**2 - 2*x0*x1 + x1**2 + x2**2 - 2*x2*x3 + x3**2)**0.5']\n", + "Checking for symmetry \n", + " example1.txt_train\n", + "Training a NN on the data... \n", + "\n", + "tensor(0.0404, device='cuda:0', grad_fn=)\n", + "tensor(0.0282, device='cuda:0', grad_fn=)\n", + "tensor(0.0354, device='cuda:0', grad_fn=)\n", + "tensor(0.0265, device='cuda:0', grad_fn=)\n", + "NN loss: tensor(0.0029, device='cuda:0', grad_fn=) \n", + "\n", + "Checking for brute force + \n", + "\n", + "Checking for brute force * \n", + "\n", + "Checking polyfit \n", + "\n", + "Complexity RMSE Expression\n", + "[47.56309550289244, 29.20117684355327, 2.07930612564087]\n", + "[50.5090504796962, 28.162061596052734, '0.005215765238+sqrt((x2*x2))']\n", + "[53.788821841164236, 27.623981263190988, '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", + "[118.35791391022252, 27.41497824744871, -0.971029222011566*cos(x2) + cos(x0 + sin(x1)) + 2.61414766311646]\n", + "[174.23364071878729, 27.411232030672863, '0.2*x0**2 - 0.444444444444444*x0*x1 + 0.117043664748057*x0 + 0.2*x1**2 + 0.111111111111111*x1 + 0.215954831506172*x2**2 + 0.618452302296974']\n", + "[202.75973089793666, 26.4718092017765, -0.971062898635864*cos(x2) - 0.97521698474884*cos(x0 - 0.988607943058014*x1) + 2.4916136264801]\n", + "Checking for brute force + \n", + "\n", + "Checking for brute force * \n", + "\n", + "Checking polyfit \n", + "\n", + "Complexity RMSE Expression\n", + "[26.416665599935456, 31.151831594084907, '-tan(0.1*x0*x1 - 0.625)']\n", + "[40.392864438595524, 29.960782005496213, 'tan(-23.126257072703+exp(pi))']\n", + "[40.393057897115405, 29.960777143296564, 'tan(-3.127155157913+pi)']\n", + "[46.0166311684591, 29.95909299612648, '0.711846380458438']\n", + "[46.5605178945111, 27.13368508267342, 1.03779721260071]\n", + "[46.56056711257602, 27.133459108345154, 1.03783261803319]\n", + "[46.56057649641146, 27.13342067603215, 1.03783936851191]\n", + "[46.560576570214884, 27.133420535207133, 1.03783942160429]\n", + "[46.56058152917947, 27.13339217046357, 1.03784298896790]\n", + "[46.68158917359681, 26.85871306245941, 'tan(-0.845761305278*(x1-(x1+1)))']\n", + "[151.3842928046349, 26.449089073084824, -0.889655292034149*tan(0.102245159447193*cos(x2) - 0.877891777343642)]\n", + "Checking for brute force + \n", + "\n", + "Checking for brute force * \n", + "\n", + "Checking polyfit \n", + "\n", + "Complexity RMSE Expression\n", + "[0.0, 30.834454019627426, '0']\n", + "[4.0, 30.771263892512106, 'acos(-666.000000000000*(x1-((x1+1)-1)))']\n", + "[13.60964047443681, 30.24841398745967, 'acos(0.000000000038*(x0+exp(exp(pi))))']\n", + "[40.392864438595524, 29.960782005496213, 'tan(-23.126257072703+exp(pi))']\n", + "[40.393057897115405, 29.960777143296564, 'tan(-3.127155157913+pi)']\n", + "[44.620081767607, 28.75693944878952, -0.270385265350342]\n", + "[46.5605178945111, 27.13368508267342, 1.03779721260071]\n", + "[46.56056711257602, 27.133459108345154, 1.03783261803319]\n", + "[46.56057649641146, 27.13342067603215, 1.03783936851191]\n", + "[46.560576570214884, 27.133420535207133, 1.03783942160429]\n", + "[46.56058152917947, 27.13339217046357, 1.03784298896790]\n", + "[46.68158917359681, 26.85871306245941, 'tan(-0.845761305278*(x1-(x1+1)))']\n", + "[151.3842928046349, 26.449089073084824, -0.889655292034149*tan(0.102245159447193*cos(x2) - 0.877891777343642)]\n", + "Checking for brute force + \n", + "\n", + "Checking for brute force * \n", + "\n", + "Checking polyfit \n", + "\n", + "Complexity RMSE Expression\n", + "[0.0, 30.834454019627426, '0']\n", + "[4.0, 30.771263892512106, 'acos(-666.000000000000*(x1-((x1+1)-1)))']\n", + "[13.60964047443681, 30.24841398745967, 'acos(0.000000000038*(x0+exp(exp(pi))))']\n", + "[39.56224242422107, 27.05989455935905, 'log(3*x0**2 - 6*x0*x1 - x0 + 3*x1**2 - x1 + 3*x2**2)']\n", + "[46.68158917359681, 26.85871306245941, 'tan(-0.845761305278*(x1-(x1+1)))']\n", + "[151.3842928046349, 26.449089073084824, -0.889655292034149*tan(0.102245159447193*cos(x2) - 0.877891777343642)]\n", + "Checking for brute force + \n", + "\n", + "Checking for brute force * \n", + "\n", + "Checking polyfit \n", + "\n", + "Complexity RMSE Expression\n", + "[0.0, 30.834454019627426, '0']\n", + "[2.0, 30.21233279612709, '0.500000000000000']\n", + "[32.00876552846736, 28.13821400441772, '1/(-0.934925954011+x1)']\n", + "[39.56224242422107, 27.05989455935905, 'log(3*x0**2 - 6*x0*x1 - x0 + 3*x1**2 - x1 + 3*x2**2)']\n", + "[46.68158917359681, 26.85871306245941, 'tan(-0.845761305278*(x1-(x1+1)))']\n", + "[151.3842928046349, 26.449089073084824, -0.889655292034149*tan(0.102245159447193*cos(x2) - 0.877891777343642)]\n", + "Checking for brute force + \n", + "\n", + "Checking for brute force * \n", + "\n", + "Checking polyfit \n", + "\n", + "Complexity RMSE Expression\n", + "[0.0, 30.834454019627426, '0']\n", + "[2.0, 30.21233279612709, '0.500000000000000']\n", + "[26.736183635149136, 28.02326246238811, exp(-0.119926199316978*exp(exp(cos(x2))))]\n", + "[39.56224242422107, 27.05989455935905, 'log(3*x0**2 - 6*x0*x1 - x0 + 3*x1**2 - x1 + 3*x2**2)']\n", + "[46.68158917359681, 26.85871306245941, 'tan(-0.845761305278*(x1-(x1+1)))']\n", + "[151.3842928046349, 26.449089073084824, -0.889655292034149*tan(0.102245159447193*cos(x2) - 0.877891777343642)]\n", + "Checking for brute force + \n", + "\n", + "Checking for brute force * \n", + "\n", + "Checking polyfit \n", + "\n", + "Complexity RMSE Expression\n", + "[0.0, 30.834454019627426, '0']\n", + "[2.0, 30.21233279612709, '0.500000000000000']\n", + "[26.736183635149136, 28.02326246238811, exp(-0.119926199316978*exp(exp(cos(x2))))]\n", + "[39.56224242422107, 27.05989455935905, 'log(3*x0**2 - 6*x0*x1 - x0 + 3*x1**2 - x1 + 3*x2**2)']\n", + "[46.68158917359681, 26.85871306245941, 'tan(-0.845761305278*(x1-(x1+1)))']\n", + "[151.3842928046349, 26.449089073084824, -0.889655292034149*tan(0.102245159447193*cos(x2) - 0.877891777343642)]\n", + "Checking for brute force + \n", + "\n", + "Checking for brute force * \n", + "\n", + "Checking polyfit \n", + "\n", + "Complexity RMSE Expression\n", + "[0.0, 30.834454019627426, '0']\n", + "[2.0, 30.21233279612709, '0.500000000000000']\n", + "[26.736183635149136, 28.02326246238811, exp(-0.119926199316978*exp(exp(cos(x2))))]\n", + "[39.56224242422107, 27.05989455935905, 'log(3*x0**2 - 6*x0*x1 - x0 + 3*x1**2 - x1 + 3*x2**2)']\n", + "[46.68158917359681, 26.85871306245941, 'tan(-0.845761305278*(x1-(x1+1)))']\n", + "[151.3842928046349, 26.449089073084824, -0.889655292034149*tan(0.102245159447193*cos(x2) - 0.877891777343642)]\n", + "Checking for brute force + \n", + "\n", + "Checking for brute force * \n", + "\n", + "Checking polyfit \n", + "\n", + "Complexity RMSE Expression\n", + "[0.0, 30.834454019627426, '0']\n", + "[1.0, 29.661717905473818, '1']\n", + "[26.736183635149136, 28.02326246238811, exp(-0.119926199316978*exp(exp(cos(x2))))]\n", + "[27.991334457287852, 8.839887073688955e-07, '(x0**2 - 2*x0*x1 + x1**2 + x2**2)**0.5']\n", + "Checking for brute force + \n", + "\n", + "Checking for brute force * \n", + "\n", + "Checking polyfit \n", + "\n", + "Complexity RMSE Expression\n", + "[0.0, 30.834454019627426, '0']\n", + "[1.0, 29.661717905473818, '1']\n", + "[26.736183635149136, 28.02326246238811, exp(-0.119926199316978*exp(exp(cos(x2))))]\n", + "[27.991334457287852, 8.839887073688955e-07, '(x0**2 - 2*x0*x1 + x1**2 + x2**2)**0.5']\n", + "Checking for symmetry \n", + " example1.txt_train-translated_minus\n", + "Found pretrained NN \n", + "\n", + "tensor(0.0134, device='cuda:0', grad_fn=)\n", + "tensor(0.0198, device='cuda:0', grad_fn=)\n", + "tensor(0.0220, device='cuda:0', grad_fn=)\n", + "NN loss after training: tensor(0.0051, device='cuda:0', grad_fn=) \n", + "\n", + "Checking for brute force + \n", + "\n", + "Checking for brute force * \n", + "\n", + "Checking polyfit \n", + "\n", + "Complexity RMSE Expression\n", + "[16.779565475879124, 0.0, '0.000000000000+sqrt(((x1*x1)+(x0*x0)))']\n", + "Checking for brute force + \n", + "\n", + "Checking for brute force * \n", + "\n", + "Checking polyfit \n", + "\n", + "Complexity RMSE Expression\n", + "[16.779565475879124, 0.0, '0.000000000000+sqrt(((x1*x1)+(x0*x0)))']\n", + "Checking for brute force + \n", + "\n", + "Checking for brute force * \n", + "\n", + "Checking polyfit \n", + "\n", + "Complexity RMSE Expression\n", + "[4.0, 29.274727392929375, 'pi/2']\n", + "[16.779565475879124, 0.0, '0.000000000000+sqrt(((x1*x1)+(x0*x0)))']\n", + "Checking for brute force + \n", + "\n", + "Checking for brute force * \n", + "\n", + "Checking polyfit \n", + "\n", + "Complexity RMSE Expression\n", + "[4.0, 29.274727392929375, 'pi/2']\n", + "[16.779565475879124, 0.0, '0.000000000000+sqrt(((x1*x1)+(x0*x0)))']\n", + "Checking for brute force + \n", + "\n", + "Checking for brute force * \n", + "\n", + "Checking polyfit \n", + "\n", + "Complexity RMSE Expression\n", + "[4.0, 29.274727392929375, 'pi/2']\n", + "[16.779565475879124, 0.0, '0.000000000000+sqrt(((x1*x1)+(x0*x0)))']\n", + "Checking for brute force + \n", + "\n", + "Checking for brute force * \n", + "\n", + "Checking polyfit \n", + "\n", + "Complexity RMSE Expression\n", + "[4.0, 29.274727392929375, 'pi/2']\n", + "[16.779565475879124, 0.0, '0.000000000000+sqrt(((x1*x1)+(x0*x0)))']\n", + "Checking for brute force + \n", + "\n", + "Checking for brute force * \n", + "\n", + "Checking polyfit \n", + "\n", + "Complexity RMSE Expression\n", + "[4.0, 29.274727392929375, 'pi/2']\n", + "[16.779565475879124, 0.0, '0.000000000000+sqrt(((x1*x1)+(x0*x0)))']\n", + "Checking for brute force + \n", + "\n", + "Checking for brute force * \n", + "\n", + "Checking polyfit \n", + "\n", + "Complexity RMSE Expression\n", + "[4.0, 29.274727392929375, 'pi/2']\n", + "[16.779565475879124, 0.0, '0.000000000000+sqrt(((x1*x1)+(x0*x0)))']\n", + "Checking for brute force + \n", + "\n", + "Checking for brute force * \n", + "\n", + "Checking polyfit \n", + "\n", + "Complexity RMSE Expression\n", + "[1.0, 29.661717905473818, '1']\n", + "[4.0, 29.274727392929375, 'pi/2']\n", + "[13.169925001442312, 0.0, '(x0**2 + x1**2)**0.5']\n", + "Checking for brute force + \n", + "\n", + "Checking for brute force * \n", + "\n", + "Checking polyfit \n", + "\n", + "Complexity RMSE Expression\n", + "[1.0, 29.661717905473818, '1']\n", + "[4.0, 29.274727392929375, 'pi/2']\n", + "[13.169925001442312, 0.0, '(x0**2 + x1**2)**0.5']\n", + "Checking for symmetry \n", + " example1.txt_train-translated_minus-translated_minus\n", + "Found pretrained NN \n", + "\n", + "tensor(0.0258, device='cuda:0', grad_fn=)\n", + "tensor(0.0227, device='cuda:0', grad_fn=)\n", + "tensor(0.0499, device='cuda:0', grad_fn=)\n", + "NN loss after training: tensor(0.0171, device='cuda:0', grad_fn=) \n", + "\n", + "Checking for brute force + \n", + "\n", + "Checking for brute force * \n", + "\n", + "Checking polyfit \n", + "\n", + "Complexity RMSE Expression\n", + "[12.1357092861044, 29.214205611514426, '1.78000000000000']\n", + "[27.36452797660028, 28.767880375411565, '0.04*x0**2 + 1.78']\n", + "[61.704892355813804, 27.90519712519376, '1.002287261112*log((pi+(x0*x0)))']\n", + "Checking for brute force + \n", + "\n", + "Checking for brute force * \n", + "\n", + "Checking polyfit \n", + "\n", + "Complexity RMSE Expression\n", + "[12.1357092861044, 29.214205611514426, '1.78000000000000']\n", + "[27.36452797660028, 28.767880375411565, '0.04*x0**2 + 1.78']\n", + "[46.5605178945111, 27.13368508267342, 1.03779721260071]\n", + "[46.560609037047406, 27.133341532987984, 1.03786277770996]\n", + "[46.56082212240015, 27.132627863336616, 1.03801608085632]\n", + "[159.48362903293216, 26.68961200174967, tan(1.36156690120697*cos(exp(exp(x0 - 1.45150196552277*exp(x0))))**0.627788364887238)]\n", + "Checking for brute force + \n", + "\n", + "Checking for brute force * \n", + "\n", + "Checking polyfit \n", + "\n", + "Complexity RMSE Expression\n", + "[4.0, 29.274727392929375, 'pi/2']\n", + "[12.1357092861044, 29.214205611514426, '1.78000000000000']\n", + "[27.36452797660028, 28.767880375411565, '0.04*x0**2 + 1.78']\n", + "[44.619738251519436, 28.75697271359565, -0.270320892333984]\n", + "[44.620081767607, 28.75693944878952, -0.270385265350342]\n", + "[46.5605178945111, 27.13368508267342, 1.03779721260071]\n", + "[46.560609037047406, 27.133341532987984, 1.03786277770996]\n", + "[46.56082212240015, 27.132627863336616, 1.03801608085632]\n", + "[159.48362903293216, 26.68961200174967, tan(1.36156690120697*cos(exp(exp(x0 - 1.45150196552277*exp(x0))))**0.627788364887238)]\n", + "Checking for brute force + \n", + "\n", + "Checking for brute force * \n", + "\n", + "Checking polyfit \n", + "\n", + "Complexity RMSE Expression\n", + "[4.0, 29.274727392929375, 'pi/2']\n", + "[12.1357092861044, 29.214205611514426, '1.78000000000000']\n", + "[12.584962500721156, 28.563725251344263, 'log(x0**2 + 7)']\n", + "[22.53445297804259, 28.460572241792615, 'log(0.888888888888889*x0**2 + 7)']\n", + "[35.60876171948284, 28.441523309583, 'log(0.888888888888889*x0**2 + 6.89)']\n", + "[46.5605178945111, 27.13368508267342, 1.03779721260071]\n", + "[46.560609037047406, 27.133341532987984, 1.03786277770996]\n", + "[46.56082212240015, 27.132627863336616, 1.03801608085632]\n", + "[159.48362903293216, 26.68961200174967, tan(1.36156690120697*cos(exp(exp(x0 - 1.45150196552277*exp(x0))))**0.627788364887238)]\n", + "Checking for brute force + \n", + "\n", + "Checking for brute force * \n", + "\n", + "Checking polyfit \n", + "\n", + "Complexity RMSE Expression\n", + "[4.0, 29.274727392929375, 'pi/2']\n", + "[12.1357092861044, 29.214205611514426, '1.78000000000000']\n", + "[12.584962500721156, 28.563725251344263, 'log(x0**2 + 7)']\n", + "[22.53445297804259, 28.460572241792615, 'log(0.888888888888889*x0**2 + 7)']\n", + "[35.60876171948284, 28.441523309583, 'log(0.888888888888889*x0**2 + 6.89)']\n", + "[46.070972708611805, 28.114455148352643, 0.739170650917556]\n", + "[46.5605178945111, 27.13368508267342, 1.03779721260071]\n", + "[46.560609037047406, 27.133341532987984, 1.03786277770996]\n", + "[46.56082212240015, 27.132627863336616, 1.03801608085632]\n", + "[159.48362903293216, 26.68961200174967, tan(1.36156690120697*cos(exp(exp(x0 - 1.45150196552277*exp(x0))))**0.627788364887238)]\n", + "Checking for brute force + \n", + "\n", + "Checking for brute force * \n", + "\n", + "Checking polyfit \n", + "\n", + "Complexity RMSE Expression\n", + "[3.0, 29.304496932666545, '1.50000000000000']\n", + "[4.0, 28.26178092441696, 'exp(-23.140666108580+exp(pi))']\n", + "[42.736802128832295, 28.259201258812894, 'exp(0.000000392728*(sin((pi-(cos(x0)-1))))**(-1))']\n", + "[46.070972708611805, 28.114455148352643, 0.739170650917556]\n", + "[46.5605178945111, 27.13368508267342, 1.03779721260071]\n", + "[46.560609037047406, 27.133341532987984, 1.03786277770996]\n", + "[46.56082212240015, 27.132627863336616, 1.03801608085632]\n", + "[159.48362903293216, 26.68961200174967, tan(1.36156690120697*cos(exp(exp(x0 - 1.45150196552277*exp(x0))))**0.627788364887238)]\n", + "Checking for brute force + \n", + "\n", + "Checking for brute force * \n", + "\n", + "Checking polyfit \n", + "\n", + "Complexity RMSE Expression\n", + "[3.0, 29.304496932666545, '1.50000000000000']\n", + "[4.0, 28.26178092441696, 'exp(-23.140666108580+exp(pi))']\n", + "[23.550746785383243, 27.481599263478095, 'asin(-0.02*x0**2 + 0.7)']\n", + "[46.5605178945111, 27.13368508267342, 1.03779721260071]\n", + "[46.560609037047406, 27.133341532987984, 1.03786277770996]\n", + "[46.56082212240015, 27.132627863336616, 1.03801608085632]\n", + "[159.48362903293216, 26.68961200174967, tan(1.36156690120697*cos(exp(exp(x0 - 1.45150196552277*exp(x0))))**0.627788364887238)]\n", + "Checking for brute force + \n", + "\n", + "Checking for brute force * \n", + "\n", + "Checking polyfit \n", + "\n", + "Complexity RMSE Expression\n", + "[3.0, 29.304496932666545, '1.50000000000000']\n", + "[4.0, 28.26178092441696, 'exp(-23.140666108580+exp(pi))']\n", + "[23.550746785383243, 27.481599263478095, 'asin(-0.02*x0**2 + 0.7)']\n", + "[46.5605178945111, 27.13368508267342, 1.03779721260071]\n", + "[46.560609037047406, 27.133341532987984, 1.03786277770996]\n", + "[46.56082212240015, 27.132627863336616, 1.03801608085632]\n", + "[159.48362903293216, 26.68961200174967, tan(1.36156690120697*cos(exp(exp(x0 - 1.45150196552277*exp(x0))))**0.627788364887238)]\n", + "Checking for brute force + \n", + "\n", + "Checking for brute force * \n", + "\n", + "Checking polyfit \n", + "\n", + "Complexity RMSE Expression\n", + "[3.0, 29.304496932666545, '1.50000000000000']\n", + "[4.0, 28.26178092441696, 'exp(-23.140666108580+exp(pi))']\n", + "[23.550746785383243, 27.481599263478095, 'asin(-0.02*x0**2 + 0.7)']\n", + "[46.5605178945111, 27.13368508267342, 1.03779721260071]\n", + "[46.560609037047406, 27.133341532987984, 1.03786277770996]\n", + "[46.56082212240015, 27.132627863336616, 1.03801608085632]\n", + "[159.48362903293216, 26.68961200174967, tan(1.36156690120697*cos(exp(exp(x0 - 1.45150196552277*exp(x0))))**0.627788364887238)]\n", + "Checking for brute force + \n", + "\n", + "Checking for brute force * \n", + "\n", + "Checking polyfit \n", + "\n", + "Complexity RMSE Expression\n", + "[3.0, 29.304496932666545, '1.50000000000000']\n", + "[4.0, 28.26178092441696, 'exp(-23.140666108580+exp(pi))']\n", + "[23.550746785383243, 27.481599263478095, 'asin(-0.02*x0**2 + 0.7)']\n", + "[46.5605178945111, 27.13368508267342, 1.03779721260071]\n", + "[46.560609037047406, 27.133341532987984, 1.03786277770996]\n", + "[46.56082212240015, 27.132627863336616, 1.03801608085632]\n", + "[159.48362903293216, 26.68961200174967, tan(1.36156690120697*cos(exp(exp(x0 - 1.45150196552277*exp(x0))))**0.627788364887238)]\n", + "Checking for symmetry \n", + " example1.txt_train-translated_minus-translated_minus-translated_multiply\n", + "Just one variable!\n", + "example1.txt_train-translated_minus-translated_minus-translated_multiply just one variable for ADD \n", + "\n", + "example1.txt_train-translated_minus-translated_minus-translated_multiply just one variable for ADD \n", + "\n", + "example1.txt_train-translated_minus-translated_minus-translated_multiply just one variable for ADD \n", + "\n", + "example1.txt_train-translated_minus-translated_minus-translated_multiply just one variable for ADD \n", + "\n", + "example1.txt_train-translated_minus-translated_minus-translated_multiply just one variable for ADD\n", + "example1.txt_train-translated_minus-translated_minus-translated_multiply just one variable for ADD\n", + "CPU times: user 31min 53s, sys: 1min 6s, total: 33min\n", + "Wall time: 1h 11min\n" + ], + "name": "stdout" + }, + { + "output_type": "execute_result", + "data": { + "text/plain": [ + "array([['30.834454019627426', '4.946471395876568', '593576.5675051882',\n", + " '0.0', '30.834454019627426', '0'],\n", + " ['29.661717905473818', '4.890530251072885', '586863.6301287463',\n", + " '1.0', '29.661717905473818', '1'],\n", + " ['29.304496932666545', '4.873050165836775', '584766.019900413',\n", + " '3.0', '29.304496932666545', '1.50000000000000'],\n", + " ['29.66164889019033', '4.820780475275042', '578493.657033005',\n", + " '4.0', '28.26178092441696', 'exp(-23.140666108580+exp(pi))'],\n", + " ['0.0', '-inf', '-inf', '13.169925001442312', '0.0',\n", + " '((x0-x1)**2 + (x2-x3)**2)**0.5']], dtype='