I don't know if i missed but ctx are embeddings already, why?

Well, the lesson 6 lab3 have this portion of code:

ctx = torch.tensor([
    # hero, non-hero, food, spell, side-facing
    [1,0,0,0,0],  
    [1,0,0,0,0],    
    [0,0,0,0,1],
    [0,0,0,0,1],    
    [0,1,0,0,0],
    [0,1,0,0,0],
    [0,0,1,0,0],
    [0,0,1,0,0],
]).float().to(device)

Where the categories are already defined, but, what if I would like to pass to the NN my own word “animal” for example. How should I convert the word to embedding?

1 Like