How can I write the below equivalent code of Keras Neural Net in Pytorch?
actor = Sequential()
actor.add(Dense(20, input_dim=9, activation='relu', kernel_initializer='he_uniform'))
actor.add(Dense(20, activation='relu'))
actor.add(Dense(27, activation='softmax', kernel_initializer='he_uniform'))
actor.summary()
# See note regarding crossentropy in cartpole_reinforce.py
actor.compile(loss='categorical_crossentropy',
optimizer=Adam(lr=self.actor_lr))[Please find the image eq here.][1]
[1]: https://i.stack.imgur.com/gJviP.png