question

Steven Chen avatar image
0 Likes"
Steven Chen asked Steven Chen edited

Poor performance of sample from Bonsai tutorial

Hello,

I am practicing Bonsai tutorial recently. The brain I trained is so bad even it has trained for 8 hours.


Sample I use is ChangeoverTimes from GitHub - flexsim/FlexSimAI at v22.2

The exported brain makes some random actions at begining because their are less items in queue (which is normal behavior), but AI starts making same action that locks ItemType to 3.

Trained brain always picks ItemType3 blue items.

02.png


Training metrics didn't change much between iterations.

01.png


Action of training iterations

action3.png


What can be the reason I make it wrong?


Another question is training speed too slow on unmanaged mode, only 6 iterations per second with my setup. Is it normal?

FlexSim 22.2.2
bonsai
02.png (191.3 KiB)
01.png (58.1 KiB)
action3.png (24.0 KiB)
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

Jordan Johnson avatar image
0 Likes"
Jordan Johnson answered Steven Chen edited

We are currently working to improve our Bonsai examples. Currently, the samples are mainly a demonstration of connecting Bonsai and FlexSim. The example shows a correct setup, but not a good setup.

In the case of the ChangeoverTimes example, there are currently several issues:

  • The Reach goal is interfering with the learning process. A Reach goal tells Bonsai to get to the value in as few actions as possible. In this particular model, that directly competes with maximizing throughput; increasing throughput means increasing the number of actions to reach the goal. When I
  • The Throughput observation is currently cumulative, but it needs to be reset between actions. With a cumulative value, Bonsai assumes that its actions get better and better later in the run, no matter what actions it takes.
  • I suspect that the Maximize goal should have a higher value than zero
  • The model itself isn't a very good learning environment. Once there are many items in the queue, Bonsai can always choose an item that matches the one previous, so that there is never a setup time again.

These issues are likely the cause of the behavior you are seeing.

As far as performance for unmanaged mode training, 5-6 iterations per second is expected. Unmanaged mode is meant for testing and debugging. For a full training run, create a Managed simulator. If an unmanaged simulator runs at 5-6 iterations per second, then a managed simulator will run at 15-20 iterations per second. In addition, Bonsai can use many instances of a managed simulator simultaneously.

· 2
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Jordan Johnson avatar image Jordan Johnson ♦♦ commented ·

I posted a new version of that sample in the FlexSimAI repository:

https://github.com/flexsim/FlexSimAI/tree/main/bonsai/samples/MinSetupTime

It requires the 2023 beta, but I think you'll find the beta is much, much easier to use when it comes to Bonsai.

0 Likes 0 ·
Steven Chen avatar image Steven Chen Jordan Johnson ♦♦ commented ·

Glad to hear that. Thank you.

0 Likes 0 ·