Skip to main content

"PyTorch Artificial Neural Networks (ANNs) for Molecular Systems",

Project description

MolANN

This package implements classes that define PyTorch Artificial Neural Network (ANN) functions taking into account alignment (translation and rotation), and functions that depend on molecular features (bonds, angles, etc.).

Installation

The package can be installed via pip:

pip install molann

The installation from source is described in the Installation page.

Simple example

The following code defines an ANN as a function of a bond distance and a dihedral angle.

import MDAnalysis as mda
from molann.ann import FeatureLayer, PreprocessingANN, MolANN, create_sequential_nn
from molann.feature import Feature

# pdb file of the system
pdb_filename = '/path/to/system.pdb'
ref = mda.Universe(pdb_filename)

# define a feature that describes the bond between atoms 5 and 6.
f1 = Feature('name', 'bond', ref.select_atoms('bynum 5 6'))
# define a feature that describes the dihedral angle formed by the first 4 atoms.
f2 = Feature('name', 'dihedral', ref.select_atoms('bynum 1 3 2 4'))

# define feature layer using the above two features.
f_layer = FeatureLayer([f1,f2], use_angle_value=False)

# define the preprocessing layer.
# we do not need alignment, since both features f1 and f2 are translation- and rotation-invariant.
pp_layer = PreprocessingANN(None, f_layer)

output_dim = pp_layer.output_dimension()
# define neural network layers that contain training parameters
nn = create_sequential_nn([output_dim, 5, 3])

# define the final network
model = MolANN(pp_layer, nn)

torch.jit.script(model).save('model.pt')

More examples for each class can be found in the MolANN docs .

Documentataion

Please refer to MolANN docs.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

molann-1.1.7.tar.gz (11.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

molann-1.1.7-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

Details for the file molann-1.1.7.tar.gz.

File metadata

  • Download URL: molann-1.1.7.tar.gz
  • Upload date:
  • Size: 11.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/6.0.0 pkginfo/1.8.3 requests/2.28.2 requests-toolbelt/0.9.1 tqdm/4.64.1 CPython/3.10.8

File hashes

Hashes for molann-1.1.7.tar.gz
Algorithm Hash digest
SHA256 2dc0644de5f6ddfcc810066f02aa265c2281f14b65fe1ae2d0a95f654526525a
MD5 bdbe442b73499c32d6568a728d4c6f62
BLAKE2b-256 ab59b808a9b13d2c0bfff331978ef61702a8e6ec5d1832516377fdecadeb422f

See more details on using hashes here.

File details

Details for the file molann-1.1.7-py3-none-any.whl.

File metadata

  • Download URL: molann-1.1.7-py3-none-any.whl
  • Upload date:
  • Size: 11.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/6.0.0 pkginfo/1.8.3 requests/2.28.2 requests-toolbelt/0.9.1 tqdm/4.64.1 CPython/3.10.8

File hashes

Hashes for molann-1.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 4b972ca90c6caea2be361786472e74141187c15907a77a0f0daad55572ed45c1
MD5 a4681bc20f7a944e7c250fecb0ea41e5
BLAKE2b-256 501294d899fe8b406018df21cc66a7497bd1cf5f368fb981251e3e98cd6bdebf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page