Comments (4)
In the code example you posted, seq_i
corresponds to the original sequence (len x), but token_representations[i].size(0) == x+2
.
Does this code example help to clear things up?
>>> begin, end = 0, 2
>>> seq = [5,5]
>>> tokens = [begin] + seq + [end]
>>> tokens[1 : len(seq) + 1]
[5, 5]
from esm.
Hi @mboedigh, the stop token is not included in the sequence representation. We take token representations until len(seq)+1 (and not +2) for that reason.
from esm.
Sorry, something I still don't understand
if tokens are [0,5,5,2] for a sequence = 'AA', where 0 and 2 are the begin and end tokens
then tokens[len(seq)+1] will index the 2, This is the stop token, right?
tokens[len(seq)+2] is out of bounds
from esm.
yes. thanks! I guess python 1:x is not like some other languages. I assumed too much, but also I was somehow getting 'out of bounds errors' in my own tests before I posted. thanks again.
from esm.
Related Issues (20)
- HuggingFace EsmForProteinFolding inference raises exception on Windows HOT 1
- ESM2 pretrain
- index out of bounds during zero-shot with msa1b
- how to input cropped protein for ESM-2 ? HOT 1
- AttributeError: module 'deepspeed' has no attribute 'comm' HOT 3
- Expecting multiple model of single sequence input
- requests.exceptions.SSLError :: Streamlit
- How to train LinearProjectionDistogramModel for my data๏ผ
- ESMFold for multimer fails when using HuggingFace installation HOT 1
- fold.py in naming pdb file
- Embedding
- Query on Alphabet Consistency Across Different Scales of ESM2 Models [8M, 35M, 150M, 650M, 3B, 150B]
- the specific code of the ESM2 model
- RuntimeError HOT 5
- Error when predicting contacts for heterodimer
- Failed to build openfold HOT 3
- Contact prediction for multimeric proteins HOT 1
- Why the inpu size of embedding is 33? HOT 1
- offset=24 in [Zero-shot variant prediction with protein language models]
- Different result with esmfold server HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from esm.