Skip to main content

Chytorch [kʌɪtɔːrtʃ]

Library for modeling molecules and reactions in torch way.

Installation

Use pip install chytorch to install release version.

Or pip install . in source code directory to install DEV version.

Pretrained models

Chytorch main package doesn't include models zoo. Each model has its own named package and can be installed separately. Installed models can be imported as from chytorch.zoo.<model_name> import Model.

Usage

chytorch.nn.MoleculeEncoder - core graphormer layer for molecules encoding. API is combination of torch.nn.TransformerEncoderLayer with torch.nn.TransformerEncoder.

Batch preparation:

chytorch.utils.data.MoleculeDataset - Map-like on-the-fly dataset generators for molecules. Supported chython.MoleculeContainer objects, and PaCh structures.

chytorch.utils.data.collate_molecules - collate function for torch.utils.data.DataLoader.

Note: torch DataLoader automatically do proper collation since 1.13 release.

Example:

from chytorch.utils.data import MoleculeDataset, SMILESDataset
from torch.utils.data import DataLoader

data = ['CCO', 'CC=O']
ds = MoleculeDataset(SMILESDataset(data, cache={}))
dl = DataLoader(ds, batch_size=10)

Forward call:

Molecules coded as tensors of:

  • atoms numbers shifted by 2 (e.g. hydrogen = 3). 0 - reserved for padding, 1 - reserved for CLS token, 2 - extra reservation.

  • neighbors count, including implicit hydrogens shifted by 2 (e.g. CO = CH3OH = [6, 4]). 0 - reserved for padding, 1 - extra reservation, 2 - no-neighbors, 3 - one neighbor.

  • topological distances' matrix shifted by 2 with upper limit. 0 - reserved for padding, 1 - reserved for not-connected graph components coding, 2 - self-loop, 3 - connected atoms.

    from chytorch.nn import MoleculeEncoder

    encoder = MoleculeEncoder() for b in dl: encoder(b)

Combine molecules and labels:

chytorch.utils.data.chained_collate - helper for combining different data parts. Useful for tricky input.

from torch import stack
from torch.utils.data import DataLoader, TensorDataset
from chytorch.utils.data import chained_collate, collate_molecules, MoleculeDataset

dl = DataLoader(TensorDataset(MoleculeDataset(molecules_list), properties_tensor),
    collate_fn=chained_collate(collate_molecules, stack))

Voting NN with single hidden layer:

chytorch.nn.VotingClassifier, chytorch.nn.BinaryVotingClassifier and chytorch.nn.VotingRegressor - speed optimized multiple heads for ensemble predictions.

Helper Modules:

chytorch.nn.Slicer - do tensor slicing. Useful for transformer's CLS token extraction in torch.nn.Sequence.

Data Wrappers:

In chytorch.utils.data module stored different data wrappers for simplifying ML workflows. All wrappers have torch.utils.data.Dataset interface.

  • SizedList - list wrapper with size() method. Useful with torch.utils.data.TensorDataset.
  • SMILESDataset - on-the-fly smiles to chython.MoleculeContainer or chython.ReactionContainer parser.
  • LMDBMapper - LMDB KV storage to dataset mapper.
  • TensorUnpack, StructUnpack, PickleUnpack - bytes to tensor/object unpackers

Publications

1 Bidirectional Graphormer for Reactivity Understanding: Neural Network Trained to Reaction Atom-to-Atom Mapping Task

Metadata

Release files for chytorch 1.65

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for chytorch 1.65
File
chytorch-1.65-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details
chytorch-1.65-cp311-cp311-manylinux_2_31_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.31+ x86-64 Details
chytorch-1.65-cp311-cp311-macosx_14_0_arm64.whl CPython 3.11 CPython 3.11 macOS 14.0+ ARM64 Details
chytorch-1.65-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details
chytorch-1.65-cp310-cp310-manylinux_2_31_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.31+ x86-64 Details
chytorch-1.65-cp310-cp310-macosx_14_0_arm64.whl CPython 3.10 CPython 3.10 macOS 14.0+ ARM64 Details
chytorch-1.65-cp39-cp39-win_amd64.whl CPython 3.9 CPython 3.9 Windows x86-64 Details
chytorch-1.65-cp39-cp39-manylinux_2_31_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.31+ x86-64 Details
chytorch-1.65-cp39-cp39-macosx_14_0_arm64.whl CPython 3.9 CPython 3.9 macOS 14.0+ ARM64 Details
chytorch-1.65-cp38-cp38-win_amd64.whl CPython 3.8 CPython 3.8 Windows x86-64 Details
chytorch-1.65-cp38-cp38-manylinux_2_31_x86_64.whl CPython 3.8 CPython 3.8 Linux glibc 2.31+ x86-64 Details
chytorch-1.65-cp38-cp38-macosx_14_0_arm64.whl CPython 3.8 CPython 3.8 macOS 14.0+ ARM64 Details

Total release size: 3.6 MB

Release files / chytorch-1.65-cp311-cp311-win_amd64.whl

Download URL chytorch-1.65-cp311-cp311-win_amd64.whl
Size 140.1 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
9c54339165c9cb01b4792e1bb319b20419ecc6939c8da8e4bbea9d532fd8b45d
BLAKE2b-256 checksum
How to use checksums
99e5a6a024ba40fd1c2a6f82cfc16e61250b6c5a04d53792c860f28f41428ce9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.9

Release files / chytorch-1.65-cp311-cp311-manylinux_2_31_x86_64.whl

Download URL chytorch-1.65-cp311-cp311-manylinux_2_31_x86_64.whl
Size 559.5 kB
Tags CPython 3.11 Linux glibc 2.31+ x86-64
SHA-256 checksum
How to use checksums
745b67045e5cc5885db6567d5990864d2e43405fd15464044b6414fccedb76ae
BLAKE2b-256 checksum
How to use checksums
62ca3698b7a11b38186260ce2555b7b41574384176b13a7e756585404a19ee28
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.10

Release files / chytorch-1.65-cp311-cp311-macosx_14_0_arm64.whl

Download URL chytorch-1.65-cp311-cp311-macosx_14_0_arm64.whl
Size 222.0 kB
Tags CPython 3.11 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
546582776d7c9e8be73b03a3e6aa75ca14ec3cbab6bf01ec68c99cf4189d3243
BLAKE2b-256 checksum
How to use checksums
fac47dd79b6f13e165972973f40c6423203f9c7af11a27140cd8aaa42ab4c327
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.9

Release files / chytorch-1.65-cp310-cp310-win_amd64.whl

Download URL chytorch-1.65-cp310-cp310-win_amd64.whl
Size 140.0 kB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
2826e302ed15d632c925056fdd1186fe53803f9440cf1bdc2003d3d5e898327e
BLAKE2b-256 checksum
How to use checksums
97afc68e8fbebfb4719a040c074fb10213656f662b7f2ef44eb0970f41a4a7ed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.11

Release files / chytorch-1.65-cp310-cp310-manylinux_2_31_x86_64.whl

Download URL chytorch-1.65-cp310-cp310-manylinux_2_31_x86_64.whl
Size 523.4 kB
Tags CPython 3.10 Linux glibc 2.31+ x86-64
SHA-256 checksum
How to use checksums
4f7748d996f89f63af3bd6cfb9221eee4e69f961d648b0b6f146ab16086d4c81
BLAKE2b-256 checksum
How to use checksums
81c6f86fe3858fbba097de2e22c4feb40633a5e809a7dd8275d61c88a96903cb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.15

Release files / chytorch-1.65-cp310-cp310-macosx_14_0_arm64.whl

Download URL chytorch-1.65-cp310-cp310-macosx_14_0_arm64.whl
Size 222.3 kB
Tags CPython 3.10 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
0eea7ddc40bfb9ea1b6437128f2867d9025e37befecf8580754c44acca0b457b
BLAKE2b-256 checksum
How to use checksums
312c7a307b54eaf829d81d9481bc31e4f160178cc3ab26f5c390e61736eecb5c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.11

Release files / chytorch-1.65-cp39-cp39-win_amd64.whl

Download URL chytorch-1.65-cp39-cp39-win_amd64.whl
Size 140.5 kB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
600e9f4d8f77fd9fa60e744b4eb6bd84f289cb6fa6df2aee590b83ab1973ea02
BLAKE2b-256 checksum
How to use checksums
6ff2ccb58ebd7a491d737d2e9806bf74208881657945587f76880a4f88e38cf0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.13

Release files / chytorch-1.65-cp39-cp39-manylinux_2_31_x86_64.whl

Download URL chytorch-1.65-cp39-cp39-manylinux_2_31_x86_64.whl
Size 526.6 kB
Tags CPython 3.9 Linux glibc 2.31+ x86-64
SHA-256 checksum
How to use checksums
27ea7d7b8e1fccea118cbf82c29e30ac0c41a8d33f1174e9ee2fb477f7288d07
BLAKE2b-256 checksum
How to use checksums
2a4450a76c4c7a5a61c3c4bd8e8742f9818e2c758dc48d0b2407d2e805f6ddfd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.20

Release files / chytorch-1.65-cp39-cp39-macosx_14_0_arm64.whl

Download URL chytorch-1.65-cp39-cp39-macosx_14_0_arm64.whl
Size 223.4 kB
Tags CPython 3.9 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
cd93d5086a1553c7672979369867c5d11a09c9273771284d700d290390d9c35e
BLAKE2b-256 checksum
How to use checksums
329a7de93872a8d732660ae9caa7cc0f277537f70d5a12379d14114de9b6b8ce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.13

Release files / chytorch-1.65-cp38-cp38-win_amd64.whl

Download URL chytorch-1.65-cp38-cp38-win_amd64.whl
Size 140.7 kB
Tags CPython 3.8 Windows x86-64
SHA-256 checksum
How to use checksums
56c30b2a4809e4003ae896bb9bd8821d4ac8ff429f00bf75581a08ca4f21aed1
BLAKE2b-256 checksum
How to use checksums
2bfcae4915f3454fa91d3717cce79711a05f4c0690ec032ada2f2d234f4df64e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.8.10

Release files / chytorch-1.65-cp38-cp38-manylinux_2_31_x86_64.whl

Download URL chytorch-1.65-cp38-cp38-manylinux_2_31_x86_64.whl
Size 540.3 kB
Tags CPython 3.8 Linux glibc 2.31+ x86-64
SHA-256 checksum
How to use checksums
ac8aa0343944eae55c71e9c7ace1d4e39cb3534eb2f23b409e88e7e46bfc07af
BLAKE2b-256 checksum
How to use checksums
57f9814a5a49f649fbb9c23e6c4f5378f96d9b6372bc499c0963c6869960308f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.8.18

Release files / chytorch-1.65-cp38-cp38-macosx_14_0_arm64.whl

Download URL chytorch-1.65-cp38-cp38-macosx_14_0_arm64.whl
Size 223.3 kB
Tags CPython 3.8 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
368e6c241db50077708922eeb528a29d0e20038ff63d5a8b3f47d4ec6a4762d8
BLAKE2b-256 checksum
How to use checksums
dd3d235c813758f84185863f1aa6ba50ecfce99174f5072fbd91f2453f17b7d1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.8.10

Security for chytorch 1.65

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page