bayesianflow-for-chem 2.0.3__py3-none-any.whl → 2.0.5__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of bayesianflow-for-chem might be problematic. Click here for more details.

@@ -18,7 +18,7 @@ __all__ = [
18
18
  "MLP",
19
19
  "EnsembleChemBFN",
20
20
  ]
21
- __version__ = "2.0.3"
21
+ __version__ = "2.0.5"
22
22
  __author__ = "Nianze A. Tao (Omozawa Sueno)"
23
23
 
24
24
 
@@ -130,10 +130,11 @@ def parse_cli(version: str) -> argparse.Namespace:
130
130
  """
131
131
  parser = argparse.ArgumentParser(
132
132
  description="Madmol: a CLI molecular design tool for "
133
- "de novo design and R-group replacement, "
133
+ "de novo design, R-group replacement, and sequence in-filling, "
134
134
  "based on generative route of ChemBFN method. "
135
135
  "Let's make some craziest molecules.",
136
- epilog=f"Madmol {version}, developed in Hiroshima University",
136
+ epilog=f"Madmol {version}, developed in Hiroshima University by chemists for chemists. "
137
+ "Visit https://augus1999.github.io/bayesian-flow-network-for-chemistry/ for more details.",
137
138
  formatter_class=argparse.ArgumentDefaultsHelpFormatter,
138
139
  )
139
140
  parser.add_argument(
@@ -376,9 +377,7 @@ def main_script(version: str) -> None:
376
377
 
377
378
  def selfies2token(s):
378
379
  return torch.tensor(
379
- [1]
380
- + [vocab_dict.get(i, default=unknown_idx) for i in split_selfies(s)]
381
- + [2],
380
+ [1] + [vocab_dict.get(i, unknown_idx) for i in split_selfies(s)] + [2],
382
381
  dtype=torch.long,
383
382
  )
384
383
 
@@ -1038,6 +1038,19 @@ class EnsembleChemBFN(ChemBFN):
1038
1038
  self.__delattr__("lora_enabled")
1039
1039
  self.__delattr__("lora_param")
1040
1040
  self.__delattr__("hparam")
1041
+ # ------- merge LoRA parameters to reduce the latency -------
1042
+ for _, v in self.models.items():
1043
+ for module in v.modules():
1044
+ if hasattr(module, "lora_A"):
1045
+ module.weight.data += (
1046
+ module.lora_B @ module.lora_A
1047
+ ) * module.scaling
1048
+ module.lora_enabled = False
1049
+ module.lora_A = None
1050
+ module.lora_B = None
1051
+ module.scaling = None
1052
+ module.lora_dropout = None
1053
+ v.lora_enabled = False
1041
1054
 
1042
1055
  def construct_y(
1043
1056
  self, c: Union[List[Tensor], Dict[str, Tensor]]
@@ -470,7 +470,7 @@ class GeometryConverter:
470
470
  spin: float = 0.0,
471
471
  ) -> Tuple[List[str], np.ndarray]:
472
472
  """
473
- Guess the 3D geometry from SMILES string via MMFF conformer search.
473
+ Guess the 3D geometry from SMILES string via conformer search.
474
474
 
475
475
  :param smiles: a valid SMILES string
476
476
  :param num_conformers: number of initial conformers
@@ -134,7 +134,7 @@ class Regressor(LightningModule):
134
134
  hparam: Dict[str, Union[str, int, float, bool]] = DEFAULT_REGRESSOR_HPARAM,
135
135
  ) -> None:
136
136
  """
137
- A `~lightning.LightningModule` wrapper of bayesian flow network for chemistry regression model.\n
137
+ A `~lightning.LightningModule` wrapper of bayesian flow network for chemistry regression or classification model.\n
138
138
  This module is used in training stage only. By calling `Regressor(...).export_model(YOUR_WORK_DIR)` after training,
139
139
  the models will be saved to `YOUR_WORK_DIR/model_ft.pt` (if LoRA is enabled then `YOUR_WORK_DIR/lora.pt`)
140
140
  and `YOUR_WORK_DIR/readout.pt`.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bayesianflow_for_chem
3
- Version: 2.0.3
3
+ Version: 2.0.5
4
4
  Summary: Bayesian flow network framework for Chemistry
5
5
  Home-page: https://augus1999.github.io/bayesian-flow-network-for-chemistry/
6
6
  Author: Nianze A. Tao
@@ -50,7 +50,7 @@ Dynamic: summary
50
50
 
51
51
  This is the repository of the PyTorch implementation of ChemBFN model.
52
52
 
53
- ## Build State
53
+ ### Build State
54
54
 
55
55
  [![PyPI](https://img.shields.io/pypi/v/bayesianflow-for-chem?color=ff69b4)](https://pypi.org/project/bayesianflow-for-chem/)
56
56
  ![pytest](https://github.com/Augus1999/bayesian-flow-network-for-chemistry/actions/workflows/pytest.yml/badge.svg)
@@ -0,0 +1,15 @@
1
+ bayesianflow_for_chem/__init__.py,sha256=U8ExDm5IRa-OPOLgt8VfjMDAiCmARiJonIKnZ8AVDQ0,612
2
+ bayesianflow_for_chem/cli.py,sha256=g5pjXymycpchlgRE6SKr0LjTBjUl6MFHnFdQiKjcE3Q,22803
3
+ bayesianflow_for_chem/data.py,sha256=Pl0gGWHmMKTKHpsxznvLgYPCwwlLNL7nqH19Vipjkxs,6584
4
+ bayesianflow_for_chem/model.py,sha256=QF15BLpUjEpUCneTOHoU6MswvxArPfbFMiOHjwJ9JrM,52230
5
+ bayesianflow_for_chem/scorer.py,sha256=gQFUlkyxitch02ntqcRh1ZS8aondKLynW5U6NfTQTb4,4084
6
+ bayesianflow_for_chem/spectra.py,sha256=Ba9ib1aDvTtDYbH3b4d-lIty3ZSQMu7jwehuV2KmhwA,1781
7
+ bayesianflow_for_chem/tool.py,sha256=JSlKrar1vVouTRUJBYU6lc5AQmAIaexvpUA3W3oQcKs,21284
8
+ bayesianflow_for_chem/train.py,sha256=jYkhSguW50lrcTEydCQ20yig_mmc1j7WH9KmVwBCTAo,9727
9
+ bayesianflow_for_chem/vocab.txt,sha256=HgtAZmpWYk4y8PqEVC4vqut1vE75DfRKE_10s2UW0rU,790
10
+ bayesianflow_for_chem-2.0.5.dist-info/licenses/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
11
+ bayesianflow_for_chem-2.0.5.dist-info/METADATA,sha256=qCd0LnD66eQbWlTvKDpHZHtJKmy9NQogm_k9_amEt2s,6057
12
+ bayesianflow_for_chem-2.0.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
13
+ bayesianflow_for_chem-2.0.5.dist-info/entry_points.txt,sha256=N63RMoJsr8rxuKxc7Fj802SL8J5AlpCoPkS8E3IFPLI,54
14
+ bayesianflow_for_chem-2.0.5.dist-info/top_level.txt,sha256=KHsanI3BMCt8D9Qpze2ycrF6nMa3PyojgO6eS1c8kco,22
15
+ bayesianflow_for_chem-2.0.5.dist-info/RECORD,,
@@ -1,15 +0,0 @@
1
- bayesianflow_for_chem/__init__.py,sha256=D4bOlPLzpGhxTdr4Zb96Xtoc5y5BftiiuQT-SL86a7s,612
2
- bayesianflow_for_chem/cli.py,sha256=decINvgtoDNUZy-wJvUE41ggUb-7RKZZh3Vbu0v_nSk,22695
3
- bayesianflow_for_chem/data.py,sha256=Pl0gGWHmMKTKHpsxznvLgYPCwwlLNL7nqH19Vipjkxs,6584
4
- bayesianflow_for_chem/model.py,sha256=bswVv3DiQTF3u37A80lrj_UPzklYtRH06woFfMXy84k,51643
5
- bayesianflow_for_chem/scorer.py,sha256=gQFUlkyxitch02ntqcRh1ZS8aondKLynW5U6NfTQTb4,4084
6
- bayesianflow_for_chem/spectra.py,sha256=Ba9ib1aDvTtDYbH3b4d-lIty3ZSQMu7jwehuV2KmhwA,1781
7
- bayesianflow_for_chem/tool.py,sha256=8fNe8pL5veUHHnnqV02AQXDe76miKRrZzypjb9Nu_hA,21289
8
- bayesianflow_for_chem/train.py,sha256=hGKyhGhLch-exSYPZdLXrLn3gf39Q1VLSJs2qtuikQE,9709
9
- bayesianflow_for_chem/vocab.txt,sha256=HgtAZmpWYk4y8PqEVC4vqut1vE75DfRKE_10s2UW0rU,790
10
- bayesianflow_for_chem-2.0.3.dist-info/licenses/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
11
- bayesianflow_for_chem-2.0.3.dist-info/METADATA,sha256=eR9Kn7lM9xsALxC5y2cThQQ5iiGX-atOl_sBaLdg_NM,6056
12
- bayesianflow_for_chem-2.0.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
13
- bayesianflow_for_chem-2.0.3.dist-info/entry_points.txt,sha256=N63RMoJsr8rxuKxc7Fj802SL8J5AlpCoPkS8E3IFPLI,54
14
- bayesianflow_for_chem-2.0.3.dist-info/top_level.txt,sha256=KHsanI3BMCt8D9Qpze2ycrF6nMa3PyojgO6eS1c8kco,22
15
- bayesianflow_for_chem-2.0.3.dist-info/RECORD,,