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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# PolyForm Noncommercial License 1.0.0
|
| 2 |
+
|
| 3 |
+
<https://polyformproject.org/licenses/noncommercial/1.0.0>
|
| 4 |
+
|
| 5 |
+
## Acceptance
|
| 6 |
+
|
| 7 |
+
In order to get any license under these terms, you must agree
|
| 8 |
+
to them as both strict obligations and conditions to all
|
| 9 |
+
your licenses.
|
| 10 |
+
|
| 11 |
+
## Copyright License
|
| 12 |
+
|
| 13 |
+
The licensor grants you a copyright license for the
|
| 14 |
+
software to do everything you might do with the software
|
| 15 |
+
that would otherwise infringe the licensor's copyright
|
| 16 |
+
in it for any permitted purpose. However, you may
|
| 17 |
+
only distribute the software according to [Distribution
|
| 18 |
+
License](#distribution-license) and make changes or new works
|
| 19 |
+
based on the software according to [Changes and New Works
|
| 20 |
+
License](#changes-and-new-works-license).
|
| 21 |
+
|
| 22 |
+
## Distribution License
|
| 23 |
+
|
| 24 |
+
The licensor grants you an additional copyright license
|
| 25 |
+
to distribute copies of the software. Your license
|
| 26 |
+
to distribute covers distributing the software with
|
| 27 |
+
changes and new works permitted by [Changes and New Works
|
| 28 |
+
License](#changes-and-new-works-license).
|
| 29 |
+
|
| 30 |
+
## Notices
|
| 31 |
+
|
| 32 |
+
You must ensure that anyone who gets a copy of any part of
|
| 33 |
+
the software from you also gets a copy of these terms or the
|
| 34 |
+
URL for them above, as well as copies of any plain-text lines
|
| 35 |
+
beginning with `Required Notice:` that the licensor provided
|
| 36 |
+
with the software. For example:
|
| 37 |
+
|
| 38 |
+
> Required Notice: Copyright AI Whisperers (https://github.com/Ai-Whisperers)
|
| 39 |
+
|
| 40 |
+
## Changes and New Works License
|
| 41 |
+
|
| 42 |
+
The licensor grants you an additional copyright license to
|
| 43 |
+
make changes and new works based on the software for any
|
| 44 |
+
permitted purpose.
|
| 45 |
+
|
| 46 |
+
## Patent License
|
| 47 |
+
|
| 48 |
+
The licensor grants you a patent license for the software that
|
| 49 |
+
covers patent claims the licensor can license, or becomes able
|
| 50 |
+
to license, that you would infringe by using the software.
|
| 51 |
+
|
| 52 |
+
## Noncommercial Purposes
|
| 53 |
+
|
| 54 |
+
Any noncommercial purpose is a permitted purpose.
|
| 55 |
+
|
| 56 |
+
## Personal Uses
|
| 57 |
+
|
| 58 |
+
Personal use for research, experiment, and testing for
|
| 59 |
+
the benefit of public knowledge, personal study, private
|
| 60 |
+
entertainment, hobby projects, amateur pursuits, or religious
|
| 61 |
+
observance, without any anticipated commercial application,
|
| 62 |
+
is use for a permitted purpose.
|
| 63 |
+
|
| 64 |
+
## Noncommercial Organizations
|
| 65 |
+
|
| 66 |
+
Use by any charitable organization, educational institution,
|
| 67 |
+
public research organization, public safety or health
|
| 68 |
+
organization, environmental protection organization, or
|
| 69 |
+
government institution is use for a permitted purpose
|
| 70 |
+
regardless of the source of funding or obligations resulting
|
| 71 |
+
from the funding.
|
| 72 |
+
|
| 73 |
+
## Fair Use
|
| 74 |
+
|
| 75 |
+
You may have "fair use" rights for the software under the
|
| 76 |
+
law. These terms do not limit them.
|
| 77 |
+
|
| 78 |
+
## No Other Rights
|
| 79 |
+
|
| 80 |
+
These terms do not allow you to sublicense or transfer any of
|
| 81 |
+
your licenses to anyone else, or prevent the licensor from
|
| 82 |
+
granting licenses to anyone else. These terms do not imply
|
| 83 |
+
any other licenses.
|
| 84 |
+
|
| 85 |
+
## Patent Defense
|
| 86 |
+
|
| 87 |
+
If you make any written claim that the software infringes or
|
| 88 |
+
contributes to infringement of any patent, your patent license
|
| 89 |
+
for the software granted under these terms ends immediately. If
|
| 90 |
+
your company makes such a claim, your patent license ends
|
| 91 |
+
immediately for work on behalf of your company.
|
| 92 |
+
|
| 93 |
+
## Violations
|
| 94 |
+
|
| 95 |
+
The first time you are notified in writing that you have
|
| 96 |
+
violated any of these terms, or done anything with the software
|
| 97 |
+
not covered by your licenses, your licenses can nonetheless
|
| 98 |
+
continue if you come into full compliance with these terms,
|
| 99 |
+
and take practical steps to correct past violations, within
|
| 100 |
+
32 days of receiving notice. Otherwise, all your licenses
|
| 101 |
+
end immediately.
|
| 102 |
+
|
| 103 |
+
## No Liability
|
| 104 |
+
|
| 105 |
+
***As far as the law allows, the software comes as is, without
|
| 106 |
+
any warranty or condition, and the licensor will not be liable
|
| 107 |
+
to you for any damages arising out of these terms or the use
|
| 108 |
+
or nature of the software, under any kind of legal claim.***
|
| 109 |
+
|
| 110 |
+
## Definitions
|
| 111 |
+
|
| 112 |
+
The **licensor** is the entity offering these terms, and the
|
| 113 |
+
**software** is the software the licensor makes available
|
| 114 |
+
under these terms.
|
| 115 |
+
|
| 116 |
+
**You** refers to the individual or entity agreeing to these
|
| 117 |
+
terms.
|
| 118 |
+
|
| 119 |
+
**Your company** is any legal entity, sole proprietorship,
|
| 120 |
+
or other kind of organization that you work for, plus all
|
| 121 |
+
organizations that have control over, are under the control of,
|
| 122 |
+
or are under common control with that organization. **Control**
|
| 123 |
+
means ownership of substantially all the assets of an entity,
|
| 124 |
+
or the power to direct its management and policies by vote,
|
| 125 |
+
contract, or otherwise. Control can be direct or indirect.
|
| 126 |
+
|
| 127 |
+
**Your licenses** are all the licenses granted to you for the
|
| 128 |
+
software under these terms.
|
| 129 |
+
|
| 130 |
+
**Use** means anything you do with the software requiring one
|
| 131 |
+
of your licenses.
|
| 132 |
+
|
| 133 |
+
---
|
| 134 |
+
|
| 135 |
+
Required Notice: Copyright 2024-2025 AI Whisperers (https://github.com/Ai-Whisperers)
|
| 136 |
+
|
| 137 |
+
## Additional Terms for Ternary VAEs Bioinformatics
|
| 138 |
+
|
| 139 |
+
### Permitted Uses (Noncommercial)
|
| 140 |
+
|
| 141 |
+
The following uses are explicitly permitted under this license:
|
| 142 |
+
|
| 143 |
+
1. **Academic Research**: Use in university research, thesis work, and academic publications
|
| 144 |
+
2. **Educational Use**: Teaching, coursework, and educational demonstrations
|
| 145 |
+
3. **Student Projects**: Individual or group student assignments and projects
|
| 146 |
+
4. **Open Source Contributions**: Contributing improvements back to this project
|
| 147 |
+
5. **Personal Learning**: Self-study and skill development
|
| 148 |
+
6. **Public Health Research**: Research benefiting public health outcomes
|
| 149 |
+
7. **Non-profit Research**: Use by registered non-profit organizations
|
| 150 |
+
|
| 151 |
+
### Commercial Use Requires Separate License
|
| 152 |
+
|
| 153 |
+
Commercial use includes, but is not limited to:
|
| 154 |
+
|
| 155 |
+
1. Use in products or services sold for profit
|
| 156 |
+
2. Use in internal tools at for-profit companies
|
| 157 |
+
3. Use by consulting firms for client work
|
| 158 |
+
4. Training commercial AI/ML models
|
| 159 |
+
5. Integration into proprietary software
|
| 160 |
+
6. Use in clinical trials sponsored by for-profit entities
|
| 161 |
+
|
| 162 |
+
**For commercial licensing inquiries, contact: support@aiwhisperers.com**
|
| 163 |
+
|
| 164 |
+
### Attribution Requirements
|
| 165 |
+
|
| 166 |
+
When using this software in academic publications, please cite:
|
| 167 |
+
|
| 168 |
+
```bibtex
|
| 169 |
+
@software{ternary_vaes_bioinformatics,
|
| 170 |
+
author = {{AI Whisperers}},
|
| 171 |
+
title = {Ternary VAEs Bioinformatics: Hyperbolic Geometry for Discrete Algebraic Structures},
|
| 172 |
+
year = {2024-2025},
|
| 173 |
+
url = {https://github.com/Ai-Whisperers/ternary-vaes-bioinformatics},
|
| 174 |
+
license = {PolyForm Noncommercial 1.0.0}
|
| 175 |
+
}
|
| 176 |
+
```
|
| 177 |
+
|
| 178 |
+
### Trained Model Weights and Checkpoints
|
| 179 |
+
|
| 180 |
+
All trained model weights and checkpoint files (including but not limited to *.pt, *.pth files) are covered by this license.
|
| 181 |
+
|
| 182 |
+
**Covered Assets**:
|
| 183 |
+
- Variational autoencoder (VAE) model weights
|
| 184 |
+
- Encoder and decoder neural network parameters
|
| 185 |
+
- Hyperbolic projection layer weights
|
| 186 |
+
- All checkpoint files in `results/checkpoints/`
|
| 187 |
+
- Pre-trained embeddings and representations
|
| 188 |
+
|
| 189 |
+
**Restrictions**:
|
| 190 |
+
Model weights may NOT be:
|
| 191 |
+
1. Used for commercial purposes without a separate commercial license
|
| 192 |
+
2. Redistributed without this LICENSE file and proper attribution
|
| 193 |
+
3. Used to train derivative commercial models or products
|
| 194 |
+
4. Incorporated into proprietary or commercial software
|
| 195 |
+
|
| 196 |
+
**Permitted Uses**:
|
| 197 |
+
Model weights MAY be used for:
|
| 198 |
+
1. Academic research and publications
|
| 199 |
+
2. Educational purposes and coursework
|
| 200 |
+
3. Non-commercial experimentation
|
| 201 |
+
4. Reproduction of results in academic papers
|
| 202 |
+
|
| 203 |
+
For commercial use of trained model weights, contact: support@aiwhisperers.com
|
| 204 |
+
|
| 205 |
+
### Research Data and Predictions
|
| 206 |
+
|
| 207 |
+
Research data, analysis results, and third-party predictions (e.g., AlphaFold3 outputs) are subject to additional restrictions. See `research/LICENSE.md` and the NOTICE file for details.
|
requirements.txt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
torch>=2.0.0
|
| 2 |
+
numpy
|
| 3 |
+
scipy
|
test_inference.py
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import torch
|
| 2 |
+
from trainable_codon_encoder import TrainableCodonEncoder
|
| 3 |
+
|
| 4 |
+
def test():
|
| 5 |
+
print("Testing Ternary Codon Encoder inference...")
|
| 6 |
+
model = TrainableCodonEncoder(latent_dim=16, hidden_dim=64)
|
| 7 |
+
checkpoint = torch.load("pytorch_model.bin", map_location="cpu", weights_only=False)
|
| 8 |
+
model.load_state_dict(checkpoint["model_state_dict"])
|
| 9 |
+
model.eval()
|
| 10 |
+
|
| 11 |
+
# ATG index is 14
|
| 12 |
+
codon_idx = torch.tensor([14])
|
| 13 |
+
with torch.no_grad():
|
| 14 |
+
z_hyp = model(codon_idx)
|
| 15 |
+
|
| 16 |
+
print(f"Codon index: {codon_idx.item()}")
|
| 17 |
+
print(f"Hyperbolic Embedding shape: {z_hyp.shape}")
|
| 18 |
+
print(f"Embedding: {z_hyp[0, :5]}...")
|
| 19 |
+
print("Test passed!")
|
| 20 |
+
|
| 21 |
+
if __name__ == "__main__":
|
| 22 |
+
test()
|