From a0b36958004f94cec9e39e54facff6bef1c18197 Mon Sep 17 00:00:00 2001 From: Michael Poutre Date: Sun, 19 Nov 2023 00:26:57 -0800 Subject: [PATCH] refactor(Docs): Add table of all actions, and tiny cleanup --- README.md | 48 +++++++++++++++++++++++------------------------- 1 file changed, 23 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index dac6ec0..6d07581 100644 --- a/README.md +++ b/README.md @@ -29,33 +29,10 @@ See example workflow in examples folder. - Example: `"Hello World"`, `'It\'s a sunny day'` - Represents string literals. -## Functions - -Here are the available functions and their usage: - -1. **Sum Function**: - - Syntax: `sum(arg1 | arg2 | ... | argN)` - - Adds together multiple embeddings. - - Example: `sum(embedding:face1 | dog)` - -2. **Negation Function**: - - Syntax: `neg(arg)` - - Negates the output. - - Example: `neg(A embedding:happycats outside)` - -3. **Normalization Function**: - - Syntax: `norm(arg)` - - Normalizes the given vector embedding. - - Example: `norm(sum(embedding:face1 | embedding:face2))` - -4. **Difference Function**: - - Syntax: `diff(arg1 | arg2 | ... | argN)` - - Computes the difference between multiple vector embeddings. - - Example: `diff(embedding:face1 | embedding:face2)` ### Notes on Arguments: - Each function takes one or more arguments. -- An argument (`arg`) can be an embedding, a word, another function, or a quoted string. +- An argument (`arg`) can be an embedding, multiple words, another function, or a quoted string. - For functions that accept multiple arguments, they are separated by the `|` symbol. ## Examples @@ -78,4 +55,25 @@ Here are the available functions and their usage: ``` sum(king|neg(man)|woman) ``` - ``` + +## Functions + +Here are the available functions and their usage: + +| Display Name | Action Name | Description | Usage Examples | +| --- | --- | --- | --- | +| Multiply | mult | Multiplies the provided segments or actions by the multiplier. | | +| Set Dimensions | setDims | Sets the specified dimensions of the input embeddings to the specified value | | +| Negate | neg | Negates the provided segments or actions. | | +| Normalize | norm | Normalizes the provided segments or actions. | | +| Positional Embedding Scale | posScale | Scales(Multiplies) the positional embeddings of the provided segments or actions by the multiplier. | | +| Random Embedding | rand | Returns a random embedding of the specified token length, with the values optionally bounded by the second and third arguments. | | +| Difference | diff | Subtracts the segments in the order they are given. The first segment is subtracted from the second, then the third from the result, and so on. | | +| Slerp | slerp | Performs a slerp(Interpolation) between two segments or actions, with the given weight. The recommended weight is 0 - 1 | | +| Pooled Average(Experimental) | _exp-pooledAvg | Processes the provided segments or actions fully through CLIP and creates a pooled average of the last hidden state by averaging the last hidden state of each token. | | +| Sum | sum | Adds the embeddings of the provided segments or actions. | | +| Pooler Output(Experimental) | _exp-pooler | Processes the provided segments or actions fully through CLIP and returns the pooler_output from the transformer | | +| Scale Dimensions | scaleDims | Scales the specified dimensions of the input embeddings by the specified amount | | +| Ignore Positional Embeddings | postPos | Prevents positional embeddings from being applied to the provided segments or actions. | | +| Average | avg | Performs a weighted average between two segments or actions. The recommended weight is 0 - 1. | | +