symbolic-regression/notebook_1.ipynb
2020-07-15 22:09:21 +03:00

803 lines
No EOL
42 KiB
Text

{
"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"
},
"cells": [
{
"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"
}
]
},
{
"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"
}
]
},
{
"cell_type": "code",
"metadata": {
"id": "Y0gbIW5HnuQl",
"colab_type": "code",
"colab": {}
},
"source": [
"!cd /content/AI-Feynman/Code/ && ./compile.sh"
],
"execution_count": 6,
"outputs": []
},
{
"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=<DivBackward0>)\n",
"tensor(0.0282, device='cuda:0', grad_fn=<DivBackward0>)\n",
"tensor(0.0354, device='cuda:0', grad_fn=<DivBackward0>)\n",
"tensor(0.0265, device='cuda:0', grad_fn=<DivBackward0>)\n",
"NN loss: tensor(0.0029, 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",
"[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=<DivBackward0>)\n",
"tensor(0.0198, device='cuda:0', grad_fn=<DivBackward0>)\n",
"tensor(0.0220, device='cuda:0', grad_fn=<DivBackward0>)\n",
"NN loss after training: tensor(0.0051, 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",
"[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=<DivBackward0>)\n",
"tensor(0.0227, device='cuda:0', grad_fn=<DivBackward0>)\n",
"tensor(0.0499, device='cuda:0', grad_fn=<DivBackward0>)\n",
"NN loss after training: tensor(0.0171, 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",
"[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='<U32')"
]
},
"metadata": {
"tags": []
},
"execution_count": 9
}
]
},
{
"cell_type": "code",
"metadata": {
"id": "FPmFhwwXnSbJ",
"colab_type": "code",
"colab": {}
},
"source": [
""
],
"execution_count": null,
"outputs": []
}
]
}