SJ001 / AI-Feynman

MIT License
638 stars 188 forks source link

Hard to get correct results for a simple custom case `sine(2pi*10*x0) * x0` #69

Closed leoniloris closed 2 years ago

leoniloris commented 2 years ago

I'm trying to run a simbolic regression for:

np.sin(2*np.pi*10*x0) * x0

which should yield a plot like this: image

but I just can't get any useful results that remotely looks like the equation. Code to reproduce:

import aifeynman
import numpy as np

DATA_FOLDER = "./data1/"
DATA_FILE = "am_fm1"

# build data
x0 = np.arange(0, 1, 0.0001)
y = np.sin(2*np.pi*10*x0) * x0

# save data
data = np.array([x0, y]).T
np.savetxt(f"{DATA_FOLDER}/{DATA_FILE}", data)

aifeynman.run_aifeynman(DATA_FOLDER, DATA_FILE, 60, "14ops.txt", polyfit_deg=1, NN_epochs=300)
AndreScaffidi commented 1 year ago

Hi, What was the issue in the end? I'm having a similar issue.