Lambeq

Latest version: v0.4.1

Safety actively analyzes 638437 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 2 of 3

0.2.8

Changed:
- Improved the performance of `NumpyModel` when using Jax JIT-compilation.
- Dependencies: pinned the required version of DisCoPy to 0.5.X.

Fixed:
- Fixed incorrectly scaled validation loss in progress bar during model training.
- Fixed symbol type mismatch in the quantum models when a circuit was previously converted to tket.

0.2.7

Added:
- Added support for Japanese to `DepCCGParser`. (credit: KentaroAOKI https://github.com/CQCL/lambeq/pull/24)
- Overhauled the `CircuitAnsatz` interface, and added three new ansätze.
- Added helper methods to `CCGTree` to get the children of a tree.
Added a new `.tree2diagram` method to `TreeReader`, extracted from `TreeReader.sentence2diagram`.
- Added a new `TreeReaderMode` named `HEIGHT`.
- Added new methods to `Checkpoint` for creating, saving and loading checkpoints for training.
- Documentation: added a section for how to select the right model and trainer for training.
- Documentation: added links to glossary terms throughout the documentation.
- Documentation: added UML class diagrams for the sub-packages in lambeq.

Changed:
- Dependencies: bumped the minimum versions of `discopy` and `torch`.
- `IQPAnsatz` now post-selects in the Hadamard basis.
- `PytorchModel` now initialises using `xavier_uniform`.
- `CCGTree.to_json` can now be applied to `None`, returning `None`.
- Several slow imports have been deferred, making lambeq much faster to import for the first time.
- In `CCGRule.infer_rule`, direction checks have been made explicit.
- `UnarySwap` is now specified to be a `unaryBoxConstructor`.
- `BobcatParser` has been refactored for easier use with external evaluation tools.
- Documentation: headings have been organised in the tutorials into subsections.

Fixed:
- Fixed how `CCGRule.infer_rule` assigns a `punc + X` instance: if the result is `X\X` the assigned rule is `CONJUNCTION`, otherwise the rule is `REMOVE_PUNCTUATION_LEFT` (similarly for punctuation on the right).

Removed:
- Removed unnecessary override of `.from_diagrams` in `NumpyModel`.
- Removed unnecessary `kwargs` parameters from several constructors.
- Removed unused `special_cases` parameter and `_ob` method from `CircuitAnsatz`.

0.2.6

Added:
- A strict pregroups mode to the CLI. With this mode enabled, all swaps are removed from the output string diagrams by changing the ordering of the atomic types, converting them into a valid pregroup form.

Fixed:
- Adjusted the behaviour of output normalisation in quantum models. Now, `NumpyModel` always returns probabilities instead of amplitudes.
- Removed the prediction from the output of the `SPSAOptimizer`, which now returns just the loss.

0.2.5

Added:
- Added a "swapping" unary rule box to handle unary rules that change the direction of composition, improving the coverage of the `BobcatParser`.
- Added a `--version` flag to the CLI.
- Added a `make_checkpoint` method to all training models.

Changed:
- Changed the `WebParser` so that the online service to use is specified by name rather than by URL.
- Changed the `BobcatParser` to only allow one tree per category in a cell, doubling parsing speed without affecting the structure of the parse trees (in most cases).
- Made the linting of the codebase stricter, enforced by the GitHub action. The flake8 configuration can be viewed in the `setup.cfg` file.

Fixed:
- Fixed the parameter names in `CCGRule`, where `dom` and `cod` had inadvertently been swapped.

0.2.4

Added:
- Support for using `jax` as backend of `tensornetwork` when setting `use_jit=True` in the `NumpyModel`. The interface is not affected by this change, but performance of the model is significantly improved.

Fixed:
- Fix a bug that caused the `BobcatParser` and the `WebParser` to trigger an SSL certificate error using Windows.
- Fix false positives in assigning conjunction rule using the `CCGBankParser`. The rule `, + X[conj] -> X[conj]` is a case of removing left punctuation, but was being assigned conjunction erroneously.

0.2.3

Added:
- `CCGRule`: Add `symbol` method that returns the ASCII symbol of a given CCG rule.
- `CCGTree`: Extend `deriv` method with CCG output. It is now capable of returning standard CCG diagrams.
- Command-line interface: CCG mode. When enabled, the output will be a string representation of the CCG diagram corresponding to the `CCGTree` object produced by the parser, instead of DisCoPy diagram or circuit.
- Documentation: Add a troubleshooting page.

Change:
- Change the behaviour of `spiders_reader` such that the spiders decompose logarithmically. This change also affects other rewrite rules that use spiders, such as coordination and relative pronouns.
- Rename `AtomicType.PREPOSITION` to `AtomicType.PREPOSITIONAL_PHRASE`.

Fixed:
- Fix a bug that raised a `dtype` error when using the `TketModel` on Windows.
- Fix a bug that caused the normalisation of scalar outputs of circuits without open wires using a `QuantumModel`.

Page 2 of 3

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.