Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- GloVe = {{1, 2}, {3, 4}, {0, 0}};
- net = NetChain[{
- EmbeddingLayer["Weights" -> GloVe],
- LongShortTermMemoryLayer[10],
- SequenceLastLayer[],
- 2,
- SoftmaxLayer[]
- },
- "Input" -> NetEncoder[{"Tokens", {"a", "b"}}],
- "Output" -> NetDecoder[{"Class", {0, 1}}]
- ]
- data = {"a a" -> 0, "b b" -> 1, "a b" -> 0, "b a" -> 1, "a b c" -> 0};
- netT = NetTrain[net, data]
- NetExtract[netT, {1, "Weights"}]
- netT = NetTrain[net, data, LearningRateMultipliers -> {1 -> 0, _ -> 1}]
- NetExtract[netT, {1, "Weights"}]
Add Comment
Please, Sign In to add comment