Spaces:
Running
Running
MilesCranmer
commited on
Commit
•
30e2a49
1
Parent(s):
8438b3b
Describe custom complexities in options page
Browse files- docs/options.md +16 -0
docs/options.md
CHANGED
@@ -14,6 +14,7 @@ may find useful include:
|
|
14 |
- [`batching`, `batch_size`](#batching)
|
15 |
- [`variable_names`](#variable-names)
|
16 |
- [Constraining use of operators](#constraining-use-of-operators)
|
|
|
17 |
- [LaTeX and SymPy](#latex-and-sympy)
|
18 |
- [Exporting to numpy, pytorch, and jax](#exporting-to-numpy-pytorch-and-jax)
|
19 |
- [`loss`](#loss)
|
@@ -156,6 +157,21 @@ The other terms say that each multiplication can only have sub-expressions
|
|
156 |
of up to complexity 3 (e.g., 5.0 + x2) in each side, and cosine can only operate on
|
157 |
expressions of complexity 5 (e.g., 5.0 + x2 exp(x3)).
|
158 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
159 |
## LaTeX and SymPy
|
160 |
|
161 |
After running `model.fit(...)`, you can look at
|
|
|
14 |
- [`batching`, `batch_size`](#batching)
|
15 |
- [`variable_names`](#variable-names)
|
16 |
- [Constraining use of operators](#constraining-use-of-operators)
|
17 |
+
- [Custom complexities](#custom-complexity)
|
18 |
- [LaTeX and SymPy](#latex-and-sympy)
|
19 |
- [Exporting to numpy, pytorch, and jax](#exporting-to-numpy-pytorch-and-jax)
|
20 |
- [`loss`](#loss)
|
|
|
157 |
of up to complexity 3 (e.g., 5.0 + x2) in each side, and cosine can only operate on
|
158 |
expressions of complexity 5 (e.g., 5.0 + x2 exp(x3)).
|
159 |
|
160 |
+
## Custom complexity
|
161 |
+
|
162 |
+
By default, all operators, constants, and instances of variables
|
163 |
+
have a complexity of 1. The sum of the complexities of all terms
|
164 |
+
is the total complexity of an expression.
|
165 |
+
You may change this by configuring the options:
|
166 |
+
|
167 |
+
- `complexity_of_operators` - pass a dictionary of `<str>: <int>` pairs
|
168 |
+
to change the complexity of each operator. If an operator is not
|
169 |
+
specified, it will have the default complexity of 1.
|
170 |
+
- `complexity_of_constants` - supplying an integer will make all constants
|
171 |
+
have that complexity.
|
172 |
+
- `complexity_of_variables` - supplying an integer will make all variables
|
173 |
+
have that complexity.
|
174 |
+
|
175 |
## LaTeX and SymPy
|
176 |
|
177 |
After running `model.fit(...)`, you can look at
|