Skip to content

Commit

Permalink
Deployed 8bb4b9a with MkDocs version: 1.5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
younesStrittmatter committed Nov 8, 2023
1 parent 6cc72cb commit a439cdd
Show file tree
Hide file tree
Showing 10 changed files with 490 additions and 88 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1107,7 +1107,7 @@ <h2 id="about">About</h2>
<p>This project is in active development by
the <a href="https://musslick.github.io/AER_website/Research.html">Autonomous Empirical Research
Group</a>
(package developer: <a href="https://younesstrittmatter.github.io/">Younes Strittmatter</a>,
(package developer: Ioana Marinescu and <a href="https://younesstrittmatter.github.io/">Younes Strittmatter</a>,
PI: <a href="https://smusslick.com/">Sebastian Musslick</a>. This research program is supported by
Schmidt Science Fellows, in partnership with the Rhodes Trust, as well as the Carney BRAINSTORM
program at Brown University.</p>
Expand Down
2 changes: 1 addition & 1 deletion index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Marinescu\*, I., Strittmatter\*, Y, Williams, C, Musslick, S. "Expression Sample
This project is in active development by
the <a href="https://musslick.github.io/AER_website/Research.html">Autonomous Empirical Research
Group</a>
(package developer: <a href="https://younesstrittmatter.github.io/">Younes Strittmatter</a>,
(package developer: Ioana Marinescu and <a href="https://younesstrittmatter.github.io/">Younes Strittmatter</a>,
PI: <a href="https://smusslick.com/">Sebastian Musslick</a>. This research program is supported by
Schmidt Science Fellows, in partnership with the Rhodes Trust, as well as the Carney BRAINSTORM
program at Brown University.
Expand Down
120 changes: 60 additions & 60 deletions reference/src/equation_tree/tree/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion search/search_index.json

Large diffs are not rendered by default.

48 changes: 24 additions & 24 deletions sitemap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,122 +2,122 @@
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://autoresearch.github.io/equation-tree/</loc>
<lastmod>2023-11-03</lastmod>
<lastmod>2023-11-08</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://autoresearch.github.io/equation-tree/quickstart/</loc>
<lastmod>2023-11-03</lastmod>
<lastmod>2023-11-08</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://autoresearch.github.io/equation-tree/reference/SUMMARY/</loc>
<lastmod>2023-11-03</lastmod>
<lastmod>2023-11-08</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://autoresearch.github.io/equation-tree/reference/src/equation_tree/</loc>
<lastmod>2023-11-03</lastmod>
<lastmod>2023-11-08</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://autoresearch.github.io/equation-tree/reference/src/equation_tree/analysis/</loc>
<lastmod>2023-11-03</lastmod>
<lastmod>2023-11-08</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://autoresearch.github.io/equation-tree/reference/src/equation_tree/defaults/</loc>
<lastmod>2023-11-03</lastmod>
<lastmod>2023-11-08</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://autoresearch.github.io/equation-tree/reference/src/equation_tree/metrics/</loc>
<lastmod>2023-11-03</lastmod>
<lastmod>2023-11-08</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://autoresearch.github.io/equation-tree/reference/src/equation_tree/prior/</loc>
<lastmod>2023-11-03</lastmod>
<lastmod>2023-11-08</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://autoresearch.github.io/equation-tree/reference/src/equation_tree/sample/</loc>
<lastmod>2023-11-03</lastmod>
<lastmod>2023-11-08</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://autoresearch.github.io/equation-tree/reference/src/equation_tree/tree/</loc>
<lastmod>2023-11-03</lastmod>
<lastmod>2023-11-08</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://autoresearch.github.io/equation-tree/reference/src/equation_tree/src/</loc>
<lastmod>2023-11-03</lastmod>
<lastmod>2023-11-08</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://autoresearch.github.io/equation-tree/reference/src/equation_tree/src/sample_tree_structure/</loc>
<lastmod>2023-11-03</lastmod>
<lastmod>2023-11-08</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://autoresearch.github.io/equation-tree/reference/src/equation_tree/src/tree_node/</loc>
<lastmod>2023-11-03</lastmod>
<lastmod>2023-11-08</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://autoresearch.github.io/equation-tree/reference/src/equation_tree/util/</loc>
<lastmod>2023-11-03</lastmod>
<lastmod>2023-11-08</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://autoresearch.github.io/equation-tree/reference/src/equation_tree/util/conversions/</loc>
<lastmod>2023-11-03</lastmod>
<lastmod>2023-11-08</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://autoresearch.github.io/equation-tree/reference/src/equation_tree/util/io/</loc>
<lastmod>2023-11-03</lastmod>
<lastmod>2023-11-08</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://autoresearch.github.io/equation-tree/reference/src/equation_tree/util/priors/</loc>
<lastmod>2023-11-03</lastmod>
<lastmod>2023-11-08</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://autoresearch.github.io/equation-tree/reference/src/equation_tree/util/type_check/</loc>
<lastmod>2023-11-03</lastmod>
<lastmod>2023-11-08</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://autoresearch.github.io/equation-tree/tutorials/Basic%20Usage/</loc>
<lastmod>2023-11-03</lastmod>
<lastmod>2023-11-08</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://autoresearch.github.io/equation-tree/tutorials/Distance%20Metrics/</loc>
<lastmod>2023-11-03</lastmod>
<lastmod>2023-11-08</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://autoresearch.github.io/equation-tree/user-guide/additional-features/</loc>
<lastmod>2023-11-03</lastmod>
<lastmod>2023-11-08</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://autoresearch.github.io/equation-tree/user-guide/distance-metrics/</loc>
<lastmod>2023-11-03</lastmod>
<lastmod>2023-11-08</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://autoresearch.github.io/equation-tree/user-guide/equation-formats/</loc>
<lastmod>2023-11-03</lastmod>
<lastmod>2023-11-08</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://autoresearch.github.io/equation-tree/user-guide/equation-sampling/</loc>
<lastmod>2023-11-03</lastmod>
<lastmod>2023-11-08</lastmod>
<changefreq>daily</changefreq>
</url>
</urlset>
Binary file modified sitemap.xml.gz
Binary file not shown.
3 changes: 3 additions & 0 deletions user-guide/equation-formats/equation-formats.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ While the underlying format of the Equation Tree is an incomplete binary tree, i
## Tree Representation
coming soon ...

### Tree Structure
coming soon ...

## String Representation
coming soon ...

Expand Down
28 changes: 28 additions & 0 deletions user-guide/equation-formats/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,19 @@
Tree Representation
</a>

<nav class="md-nav" aria-label="Tree Representation">
<ul class="md-nav__list">

<li class="md-nav__item">
<a href="#tree-structure" class="md-nav__link">
Tree Structure
</a>

</li>

</ul>
</nav>

</li>

<li class="md-nav__item">
Expand Down Expand Up @@ -1075,6 +1088,19 @@
Tree Representation
</a>

<nav class="md-nav" aria-label="Tree Representation">
<ul class="md-nav__list">

<li class="md-nav__item">
<a href="#tree-structure" class="md-nav__link">
Tree Structure
</a>

</li>

</ul>
</nav>

</li>

<li class="md-nav__item">
Expand Down Expand Up @@ -1120,6 +1146,8 @@ <h1 id="equation-formats">Equation Formats</h1>
</ul>
<h2 id="tree-representation">Tree Representation</h2>
<p>coming soon ...</p>
<h3 id="tree-structure">Tree Structure</h3>
<p>coming soon ...</p>
<h2 id="string-representation">String Representation</h2>
<p>coming soon ...</p>
<h2 id="prefix-notation">Prefix Notation</h2>
Expand Down
130 changes: 129 additions & 1 deletion user-guide/equation-sampling/equation-sampling.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,132 @@ Various features of the underlying equation distribution can be customized. For

In our sampling method, we distinct equation structure and equation content and sample both separately:
- First, in the *(1) Structure Sampling* step, we sample the structure of the underlying tree. Here, complexity is adjusted, and we can use prior information about structures.
- Second, in the *(2) Attribute Sampling* step, we sample the content of each tree node individually. Here, we can use prior information about the occurrence probabilities of specific operators and frequencies. This information can be conditioned on the parent nodes. For example, we can use prior information about the likelihood of + appearing in a sine function.
- Second, in the *(2) Attribute Sampling* step, we sample the content of each tree node individually. Here, we can use prior information about the occurrence probabilities of specific operators and frequencies. This information can be conditioned on the parent nodes. For example, we can use prior information about the likelihood of + appearing in a sine function.

## How To Use The Sampler

To use our sampler, import the functionality and call the sample function:
```python
from equation_tree import sample

equations = sample()
```
This will return a list of sampled equations. You can customize the number of equations and the dimension of the input via the keyword arguments `n` and `max_num_variables`. For example to sample 100 equations with a maximum of 3 input variables, write:
```python
equations = sample(n=100, max_num_variables=3)
```
The most versatile way to further customize the sampling is the use of a prior. You can pass this to the sampler as a dictionary with entries for a structures prior, features, functions and operators. Here, we give an example:
```python
prior = {
'structures': {'[0, 1, 1]': .3, '[0, 1, 2]': .3, '[0, 1, 2, 3]': .4},
'features': {'constants': .2, 'variables': .8},
'functions': {'sin': .5, 'cos': .5},
'operators': {'+': 1., '-': .0},
}

# To use the prior use the keyword argument `prior`
equations = sample(prior=prior)
```
You can also include conditionals. These influence the likelihood of a specific attribute being sampled given its parent node. For example, how likely does a - occur in a sine function:
```python
prior = {
'structures': {'[0, 1, 1]': .3, '[0, 1, 2]': .3, '[0, 1, 2, 3]': .4},
'features': {'constants': .2, 'variables': .8},
'functions': {'sin': .5, 'cos': .5},
'operators': {'+': 1., '-': .0},
'function_conditionals': {
'sin': {
'features': {'constants': 0., 'variables': 1.},
'functions': {'sin': 0., 'cos': 1.},
'operators': {'+': 0., '-': 1.}
},
'cos': {
'features': {'constants': 0., 'variables': 1.},
'functions': {'cos': 1., 'sin': 0.},
'operators': {'+': 0., '-': 1.}
}
},
'operator_conditionals': {
'+': {
'features': {'constants': .5, 'variables': .5},
'functions': {'sin': 1., 'cos': 0.},
'operators': {'+': 1., '-': 0.}
},
'-': {
'features': {'constants': .3, 'variables': .7},
'functions': {'cos': .5, 'sin': .5},
'operators': {'+': .9, '-': .1}
}
},
}
```

### Possible Attributes
Here, we present which attributes are supported natively.

*You can use custom attributes for operators and functions, but other functionality like distance metrics or the evaluation of equations might not work with custom attributes.*

#### Structures
Here, we use the structure notion highlighted in the [format](equation-formats.md#tree-structure).

The Equation Tree package provides convenience functions to obtain uniform structure priors from the tree depth or from the maximum number of nodes. To call them, you can use the keyword argument in the sample function:
```python
# Sample equations with only a specified tree depth
equations = sample(depth=...)

# Sample equations up to a specified depth
equatons = sample(max_depth=...)
```


#### Features
`constants`: the likelihood of a leaf being a constant. In the Equation Tree package, constants are represented as c followed by an index (`c_{}`). The sampler doesn't sample the same constant twice.

`variables`: the likelihood of a leaf being a variable. Variables are represented as a x followed by an index (`x_{}`). Variables are sampled with replacement.

*Attention*: A function will never have a constant as it's child, since a constant in a function can be simplified to a single constant

#### Functions
Functions are mathematical operations with only one input value. Our package supports the following natively. Please ues the exact notion.
- sin
- cos
- tan
- exp
- log
- sqrt
- abs

The following operators can be added, but are not in the default priors:
- acos
- arg
- asin
- sinh
- cosh
- tanh
- cot

*Additionally, you can use `squared` and `cubed` as keys, but this might not be fully supported in all functions of the equation sampler. For example, converting to sympy expressions might lead to unexpected results.*

#### Operators
Operators are mathematical operations with two input values. Our package supports the following natively.
- \+
- \-
- \*
- \/
- \**
- max
- min

#### Conditionals
- In the function conditionals each function can has it's own prior consisting of a feature, function, and operator prior.
- In the operator conditionals each operator can has it's own prior consisting of a feature, function, and operator prior.

#### Convenience
The Equation Tree package has a convenience function that allows to transform a space into a uniform prior:
```python
from equation_tree.prior import prior_from_space

# For example if you only want to include primitive operators
operator_prior = prior_from_space(["+", "-", "*", "/"])
```

Loading

0 comments on commit a439cdd

Please sign in to comment.