WassimTenachi / PhySO

Physical Symbolic Optimization

Home Page:https://physo.readthedocs.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Implementation of operator x^n

mg-meth opened this issue · comments

Hi Wassim,

I have a question similar to "How can I add a custom operator?". Is it possible to add the operator x^n, x is an input variable and n is a free constant?

Thanks in advance

Hi @mg-meth,

Currently $x^n$ can be achieved by physo by proposing $e^{(log x).n} = (e^{log x})^n = x^n$ allowing it to pass the Nguyen symbolic regression benchmark for example.

If you want, you can add a power token in functions.py following the instructions in the readme file which will enable physo to produce $x^n$ directly making tasks necessitating power tokens easier to resolve.

This is all for $n \in \mathbb{R}$ ie. a free constants of float value.

Such a token would complicate things from a dimensional analysis perspective but if you are not interested in physics you should be able to work with this in a dimensionless framework.

Does that answer your question ?

Wassim

I've added a pow token by the way ! ;)