faster control

This commit is contained in:
wassname
2019-01-15 08:20:23 +08:00
parent b16ab6a8ca
commit 17a1ecfb66
3 changed files with 19 additions and 24 deletions
+5 -11
View File
@@ -1,17 +1,11 @@
module.exports = {
time_step: 60,
simulation_fps: 60,
draw_fps: 30,
velocity_iterations: 8,
position_iterations: 3,
time_step: 120,
draw_fps: 60,
velocity_iterations: 10,
position_iterations: 6,
max_zoom_factor: 130,
min_motor_speed: -2,
max_motor_speed: 2,
population_size: 1,
walker_health: 100,
max_floor_tiles: 50,
round_length: 1000,
min_body_delta: 0,
min_leg_delta: 0,
action_repeat: 4
action_repeat: 1
};
+4 -4
View File
@@ -68,16 +68,16 @@ class HeadlessGame {
nbActions,
resetEpisode: true,
batchSize: 8*1024,
actorLr: 0.0001/4,
actorLr: 0.0001,
criticLr: 0.001,
memorySize: 10000,
gamma: 0.99,
desiredActionStddev: 0.05,
desiredActionStddev: 0.4,
minActionStddev: 0.0001,
initialStddev: 0.2,
initialStddev: 0.8,
adoptionCoefficient: 1.01,
noiseDecay: 0.96,
noiseDecay: 0.94,
actorFirstLayerSize: 128,
actorSecondLayerSize: 64,
+10 -9
View File
@@ -10,8 +10,8 @@ const {
Renderer
} = require('./renderer')
const STRENGTH = 2.2
const SPEED = 15
const STRENGTH = 2.6
const SPEED = 30
class Walker {
constructor(world, floor, config) {
@@ -632,15 +632,16 @@ class Walker {
// reward for moving right
var position = this.torso.upper_torso.GetPosition().x
if (this.last_position === undefined) this.last_position = position
var velocity = (position - this.last_position) * 100
var velocity = (position - this.last_position) * 300
this.last_position = position
var lin_vel_reward = 2 * velocity
// punish for using energy, squared
var quad_power_cost = -0.05 * this.joints.map(j => j.GetJointSpeed()).reduce((sum, speed) => sum + speed ** 2)
quad_power_cost = Math.max(quad_power_cost, -10)
var quad_power_cost = -0.1 * this.joints.map(j => j.GetJointSpeed()).reduce((sum, speed) => sum + speed ** 2)
quad_power_cost = Math.max(quad_power_cost, -30)
// Lets be nice, all entities should find overall happiness in what they do
// Lets be nice, all entities should find
// overall happiness in what they do?
var bonus_happiness = 40
var contacts = this.bodies.map(b => b.GetContactList()).filter(b => b).length
@@ -648,10 +649,10 @@ class Walker {
this.rewards = {
lin_vel_reward,
quad_power_cost,
quad_contact_cost,
// quad_power_cost,
// quad_contact_cost,
quad_joint_angle_cost,
bonus_happiness,
// bonus_happiness,
head_height_reward,
// leg_switch_reward
}