{
  "id": 458956,
  "title": "How to pass floating point values to nn.embeddings",
  "url": "/competitions/stanford-ribonanza-rna-folding/discussion/458956",
  "author_name": "",
  "post_date": "2023-12-02T15:34:58.695084600Z",
  "votes": 1,
  "comment_count": 3,
  "views": 0,
  "content": "<p>Hi all,<br>\n I am currently using 1,2,3,4 for RNA seq characters and if I pass to nn.embeddings(4,maxlen) it works. But if I change the numbers to floating point example 0.4444,0.555,0.6666,0.7777 and pass these to NN.embedding(4,maxlen) it is throwing error stating that it expects int or Long. Can advice me please </p>",
  "messages": [
    {
      "id": "2546597",
      "postDate": "12/02/2023 15:34:58",
      "content": "<p>Hi all,<br>\n I am currently using 1,2,3,4 for RNA seq characters and if I pass to nn.embeddings(4,maxlen) it works. But if I change the numbers to floating point example 0.4444,0.555,0.6666,0.7777 and pass these to NN.embedding(4,maxlen) it is throwing error stating that it expects int or Long. Can advice me please </p>",
      "rawMarkdown": "Hi all,\n I am currently using 1,2,3,4 for RNA seq characters and if I pass to nn.embeddings(4,maxlen) it works. But if I change the numbers to floating point example 0.4444,0.555,0.6666,0.7777 and pass these to NN.embedding(4,maxlen) it is throwing error stating that it expects int or Long. Can advice me please",
      "votes": null
    },
    {
      "id": "2546680",
      "postDate": "12/02/2023 17:39:32",
      "content": "<p>Of course. They must be integers as they act as labels for the vocabulary.</p>",
      "rawMarkdown": "Of course. They must be integers as they act as labels for the vocabulary.",
      "votes": null
    },
    {
      "id": "2546682",
      "postDate": "12/02/2023 17:41:16",
      "content": "<p>Why you want pass float by the way?</p>",
      "rawMarkdown": "Why you want pass float by the way?",
      "votes": null
    },
    {
      "id": "2546691",
      "postDate": "12/02/2023 17:58:39",
      "content": "<p>In order to answer more accuratelly the way nn.embedding works is by applyng a linear transformation from initial input_size to final output_size. So for the very first aproximation of {A:0,U:1,G:2,C:3} the input_size must be 4 cause the initial vectors will be:<br>\nA:(1,0,0,0)<br>\nU:(0,1,0,0)<br>\nG:(0,0,1,0)<br>\nC:(0,0,0,1)<br>\n4 linearly independent vectors in a 4 dimension space and they will projected by the weights of the embedding layer to de desired dimension space by:<br>\nA:WA + B<br>\nU:WU + B<br>\nG:WG + B<br>\nC:WC + B<br>\nWhere W and B represents the learnable weights and bias that the layer will train. The input must be a recognizeable label for each initial vector, in this torch implementation asks for int or long.</p>",
      "rawMarkdown": "In order to answer more accuratelly the way nn.embedding works is by applyng a linear transformation from initial input_size to final output_size. So for the very first aproximation of {A:0,U:1,G:2,C:3} the input_size must be 4 cause the initial vectors will be:\nA:(1,0,0,0)\nU:(0,1,0,0)\nG:(0,0,1,0)\nC:(0,0,0,1)\n4 linearly independent vectors in a 4 dimension space and they will projected by the weights of the embedding layer to de desired dimension space by:\nA:WA + B\nU:WU + B\nG:WG + B\nC:WC + B\nWhere W and B represents the learnable weights and bias that the layer will train. The input must be a recognizeable label for each initial vector, in this torch implementation asks for int or long.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 2546680,
      "author_name": "sacuscreed",
      "author_url": "",
      "post_date": "12/02/2023 17:39:32",
      "content": "<p>Of course. They must be integers as they act as labels for the vocabulary.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 2546682,
      "author_name": "sacuscreed",
      "author_url": "",
      "post_date": "12/02/2023 17:41:16",
      "content": "<p>Why you want pass float by the way?</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 2546691,
      "author_name": "sacuscreed",
      "author_url": "",
      "post_date": "12/02/2023 17:58:39",
      "content": "<p>In order to answer more accuratelly the way nn.embedding works is by applyng a linear transformation from initial input_size to final output_size. So for the very first aproximation of {A:0,U:1,G:2,C:3} the input_size must be 4 cause the initial vectors will be:<br>\nA:(1,0,0,0)<br>\nU:(0,1,0,0)<br>\nG:(0,0,1,0)<br>\nC:(0,0,0,1)<br>\n4 linearly independent vectors in a 4 dimension space and they will projected by the weights of the embedding layer to de desired dimension space by:<br>\nA:WA + B<br>\nU:WU + B<br>\nG:WG + B<br>\nC:WC + B<br>\nWhere W and B represents the learnable weights and bias that the layer will train. The input must be a recognizeable label for each initial vector, in this torch implementation asks for int or long.</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "2546597": "Hi all,\n I am currently using 1,2,3,4 for RNA seq characters and if I pass to nn.embeddings(4,maxlen) it works. But if I change the numbers to floating point example 0.4444,0.555,0.6666,0.7777 and pass these to NN.embedding(4,maxlen) it is throwing error stating that it expects int or Long. Can advice me please",
    "2546680": "Of course. They must be integers as they act as labels for the vocabulary.",
    "2546682": "Why you want pass float by the way?",
    "2546691": "In order to answer more accuratelly the way nn.embedding works is by applyng a linear transformation from initial input_size to final output_size. So for the very first aproximation of {A:0,U:1,G:2,C:3} the input_size must be 4 cause the initial vectors will be:\nA:(1,0,0,0)\nU:(0,1,0,0)\nG:(0,0,1,0)\nC:(0,0,0,1)\n4 linearly independent vectors in a 4 dimension space and they will projected by the weights of the embedding layer to de desired dimension space by:\nA:WA + B\nU:WU + B\nG:WG + B\nC:WC + B\nWhere W and B represents the learnable weights and bias that the layer will train. The input must be a recognizeable label for each initial vector, in this torch implementation asks for int or long."
  },
  "source": "meta"
}