Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const res = sWeights.map((s, i) =>
tf.mul(s, tau).add(tf.mul(tWeights[i], 1-tau)));
layer.setWeights(res);
const action = tf.tidy(() => {
let action = tf.squeeze(this.actor.predict(tf.tensor([state])));
if (train) {
const noise = softmax(this.noise.sample());
action = action.mul(1-this.epsilon).add(tf.mul(noise, this.epsilon));
}
return action;
});
const data = await action.data();