I am unable to determine where this error is coming from:
AttentionLayer::netmissio: Net specified for the scoring net (argument 1) is missing required input port Query.
scoringNet = NetGraph[ { "queryLinear" -> LinearLayer[64, "Input" -> 64], "keyLinear" -> LinearLayer[64, "Input" -> 64], "valueLinear" -> LinearLayer[64, "Input" -> 64],(* Add this line for the Value input *) "add" -> ThreadingLayer[Plus], "activation" -> ElementwiseLayer[Tanh], "output" -> LinearLayer[1] }, { NetPort["Query"] -> "queryLinear", NetPort["Key"] -> "keyLinear", NetPort["Value"] -> "valueLinear",(* Connect Value port *) {"queryLinear", "keyLinear", "valueLinear"} -> "add" -> "activation" -> "output" }, "Query" -> {64}, "Key" -> {64}, "Value" -> {64} (* Add this line *) ] Which shows no errors. Errors show in my net:
seq2seqNet = NetGraph[{"queryTransform" -> LinearLayer[64, "Input" -> {5, 1}], "encoder" -> LongShortTermMemoryLayer[64], "attention" -> AttentionLayer[{"Query" -> 64, "Key" -> 64, "Value" -> 64}, "ScoringFunction" -> scoringNet], "decoder" -> LongShortTermMemoryLayer[64], "output" -> LinearLayer[5]}, {NetPort["Input"] -> "queryTransform", NetPort["Input"] -> "encoder", "encoder" -> NetPort["attention", "Key"], "queryTransform" -> NetPort["attention", "Query"], "encoder" -> NetPort["attention", "Value"], {"encoder", "attention"} -> "decoder", "decoder" -> "output"}, "Input" -> {5, 1}, "Output" -> {5}]