synaptic icon indicating copy to clipboard operation
synaptic copied to clipboard

Multiple simultaneous trainAsync calls doesn't produce any console output for the second trainer

Open jocooler opened this issue 8 years ago • 1 comments

I'm training a composite network with 4 parts, each with a 16-8-8-1 Perceptron architecture. I take one set of inputs, run it through 4 independent networks, and get 4 outputs. I figured since I have multiple cores on my PC, I could run multiple async trainers at once.

This seems to work - there's not a noticable slowdown, and both sets get trained (I can tell when I test the network). But the second one called doesn't log any messages. Here's what my console looks like: (Chrome 51).

trainer.trainAsync(LTCRTrainingSet, {log:1000, rate: 0.05});
Promise {[[PromiseStatus]]: "pending", [[PromiseValue]]: undefined}
{iterations: 1000, error: 0.006648069533129672, rate: 0.05}
{iterations: 2000, error: 0.006633476506902124, rate: 0.05}
ALCRtrainer.trainAsync(ALCRTrainingSet, {log:1000, rate: 0.09});
Promise {[[PromiseStatus]]: "pending", [[PromiseValue]]: undefined}
{iterations: 3000, error: 0.00662538786630203, rate: 0.05}
{iterations: 4000, error: 0.006620154648585848, rate: 0.05}
{iterations: 5000, error: 0.006616466049756527, rate: 0.05}
{iterations: 6000, error: 0.006613635870878663, rate: 0.05}
{iterations: 7000, error: 0.006611294232752252, rate: 0.05}
{iterations: 8000, error: 0.0066092423264845455, rate: 0.05}

jocooler avatar Aug 05 '16 16:08 jocooler

Hi @jocooler

I tried replicating this with the following code:

trainer.trainAsync(getTrainingSet(),{
      rate: .1,
      iterations: 1000,
      error: .005,
      shuffle: true,
      log: 2,
      cost: synaptic.Trainer.cost.CROSS_ENTROPY
    })

    trainer.trainAsync(getTrainingSet(),{
      rate: .2,
      iterations: 1000,
      error: .005,
      shuffle: true,
      log: 2,
      cost: synaptic.Trainer.cost.CROSS_ENTROPY
    })

And I get the following output. Note that the rate for the first one is 0.1 and the second is 0.2:

Object {iterations: 978, error: 0.006208599794258755, rate: 0.1}
Object {iterations: 654, error: 0.0063472466116271335, rate: 0.2}
Object {iterations: 980, error: 0.00619006151021269, rate: 0.1}
Object {iterations: 982, error: 0.006171320420174647, rate: 0.1}
Object {iterations: 656, error: 0.00631703030996045, rate: 0.2}
Object {iterations: 984, error: 0.006153472265073166, rate: 0.1}
Object {iterations: 658, error: 0.006286597057586242, rate: 0.2}

chrome Version 57.0.2987.133

shahrin014 avatar Apr 05 '17 07:04 shahrin014