Comments (7)
Hi, yes this is theoretically possible. This is what the Dynamic
node type is supposed to do. My plan is to eventually get rid of all the hard-coded function types and only rely on functions registered at runtime.
The idea is to define a custom function and register it in the dispatch table. Here is an example:
-
define a custom
summation_function
https://github.com/foolnotion/atomic-potentials/blob/5c871ea89c99a3a7e965bb61e48f848d3b4e159a/source/atomic.hpp#L72 -
register the function
https://github.com/foolnotion/atomic-potentials/blob/5c871ea89c99a3a7e965bb61e48f848d3b4e159a/source/main.cpp#L219 -
define a
Dynamic
node type with this function and add it to the primitive set
https://github.com/foolnotion/atomic-potentials/blob/5c871ea89c99a3a7e965bb61e48f848d3b4e159a/source/main.cpp#L229
The atomic potentials code relies on an older version of Operon but you should be able to make it work with the latest cpp20
head.
If you run into issues or find bugs please let me know.
from operon.
Thanks a lot for the detailed explanation and links to the files. I am now understanding the code better. Let me try to implement the idea and update. Appreciate the prompt response!
from operon.
I was slowly learning the concepts, and there is a few more questions if you don't mind.
- I do not understand the
if
branch at here. What does it mean bysymbolic == true
orsymbolic == false
? How is this related to the template argument to beint
orScalar
? - There are a few options for
TreeCreator
. Is there a rule of thumb to pick from those candidates before digging into the implementation? - On
c++20
branch, In order to create anInterpreter
, it requires having a dispatch table, a dataset and atree
. I am not sure what thetree
that I should supply to it. My current vague understanding is that trees are "symbolic formulas" generated as candidates for evaluation during the solving phase of the algorithm. And because of this (probably wrong) understanding, I found it confusing how and why I should provide atree
toInterpreter
construction, which happens before the algorithm starts running.
Thanks a lot! Still, sorry if some of the questions seems dumb, I didn't have time to full go through all the detailed code yet.
from operon.
I do not understand the if branch at here. What does it mean by symbolic == true or symbolic == false? How is this related to the template argument to be int or Scalar?
The symbolic
boolean flag was meant to configure the algorithm in a certain way as to promote "nice" models (formulas):
- only integer coefficients (during the run and during initialization)
- mutation operator configured to only support integer values
- nonlinear least squares coefficient tuning disabled
There are a few options for TreeCreator. Is there a rule of thumb to pick from those candidates before digging into the implementation?
In general I've noticed that the choice of creator does not make a difference in algorithm performance. I would recommend using the BalancedTreeCreator
which imho is a better version of PTC2
. It may also be beneficial to limit max tree size during initialization to a smaller limit (5-15 nodes). Keep the max tree size during the run to a larger value.
On c++20 branch, In order to create an Interpreter, it requires having a dispatch table, a dataset and a tree. I am not sure what the tree that I should supply to it.
Yes, this was a big change from before, in the interest of making it easier to program the entire tree evaluation / optimization infrastructure and integration with likelihoods.
The tree is kept in the Genotype
property of the Individual
https://github.com/heal-research/operon/blob/cpp20/include/operon/core/individual.hpp#L18
So normally you'd want to use an interpreter in a context where you already have an individual, so then you'd pass individual.Genotype
to the interpreter.
Similar to here: https://github.com/heal-research/operon/blob/cpp20/source/operators/evaluator.cpp#L196
from operon.
Thank you for the explanation! I now understand why using int
for symbolic case and more about the tree creator!
One more question about Interpreter
if you don't mind.
I am actually creating the Interpreter
before having anything yet. This is because (I might be wrong) to create the algorithm instance (e.g. NSGA2
), it seems that the following need to be constructed:
Interpreter
⇨ ErrorEvaluator
⇨ Generator
⇨ NSGA2
If ErrorEvaluator
is going to be able to evaluate all sorts of trees, which specific tree do I need to construct to provide to the Interpreter
? This is at the stage that the algorithm is yet to be constructed - does that mean I just create an arbitrary tree by hand?
Thanks!
from operon.
Hi,
I am actually creating the Interpreter before having anything yet. This is because (I might be wrong) to create the algorithm instance (e.g. NSGA2), it seems that the following need to be constructed:
Normally you shouldn't need to initialize the interpreter yourself.
The flow should be:
DispatchTable ⇨ ErrorEvaluator ⇨ Generator ⇨ NSGA2
The specific type of interpreter can be passed as a template parameter to the DispatchTable
.
If ErrorEvaluator is going to be able to evaluate all sorts of trees, which specific tree do I need to construct to provide to the Interpreter?
The interpreter will know how to evaluate any kind of tree (or, more accurately, any type of node inside the tree) by querying the dispatch table for the appropriate function primitive. The interpreter is meant to be a lightweight cheap object initialized on the spot whenever a tree needs to be interpreted (so you'd construct an interpreter within an evaluator context when you already have a tree). You do not need to construct an interpreter manually before the algorithm.
If you show me your code I can assist more.
from operon.
This issue is stale because it has been open for 30 days with no activity.
from operon.
Related Issues (20)
- TypeError: __init__(): incompatible constructor arguments HOT 1
- getting the build process to recognize a lower python version HOT 2
- ValueError: Input contains NaN, infinity or a value too large for dtype('float32'). HOT 3
- Add option to disable evolution / optimization of variable coefficients (fix coefficients to one) HOT 2
- Usage instructions for command line interface do not show all supported symbols for --enable-symbols and --disable-symbols. HOT 1
- Python bindings HOT 6
- Evidential regression? HOT 3
- Building python binding and packaging HOT 2
- building operon HOT 9
- Can't build on linux HOT 1
- buliding problem HOT 3
- error in cmake HOT 4
- double free or corruption (out) HOT 8
- Custom cost function HOT 3
- Question about running ctest based on the instructions in HACKING.md HOT 5
- Building operon fails with a compiler error HOT 2
- Where can I find a c++ example of using operon? HOT 5
- Typo in selection operator definition produces segfault on CLI HOT 1
- Update license and file headers HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from operon.