Since you build a classification model, you shouldn’t use the outr1 after outr1, _ = self.lstm1(X_embed) for further processing. outr1 contains the last hidden states (last w.r.t. to the number of LSTM layers, in case you have more than one). This is why you have a shape of (batch_size, seq_len, hidden_size), in your case (1, 512, 128). While you can use outr1, you need to concatenate, average, maxpool, etc. first. As a first approach, I would suggest the following: change the line(s) to
outr1, (h, c) = self.lstm1(X_embed)
h = h[-1] 
xr = self.dropout(h)

h = h[-1] yields the last hidden state (last with respect to the number of time steps) and has a shape of (batch_size, hidden_size), in your case (1, 128). This is what you want and can push through the remaining Dropout and Linear layers down down to (1, 1)
Apart from anything, why is you input sequence 512 items long, with most of them being 0 (I assume for padding)? Since you use a batch size of 1 anyway, you don’t need padding, and 512 is too long to properly learn a vanilla LSTM, I would argue.