transfer learning

transfer learning

a9080109
Explorer Explorer
26 Views
36 Replies
Message 1 of 37

transfer learning

a9080109
Explorer
Explorer

[ FlexSim 20.0.10 ]

This is a new way of learning, and when I read the literature, I saw that transfer learning can be implemented using reinforcement learning, but my question now is how can I implement this problem in Py provided by Flexsimallcombos-22-0-1.fsmflexsim_training.zip

https://github.com/trunghieu-tran/Transfer-Learning-in-Reinforcement-Learning

27 Views
36 Replies
Replies (36)
Message 2 of 37

allister_wilson
Not applicable
This seems like a Python question, not a FlexSim question.

Is there something specific you're struggling with which directly involves FlexSim, or how the reinforcement learning tool interacts with Python?

0 Likes
Message 3 of 37

julie_weller
Not applicable

Have you looked at the Reinforcement learning tutorial on the docs website?

https://docs.flexsim.com/en/23.1/ModelLogic/ReinforcementLearning/WorkingWithGym/Training/Training.h...

0 Likes
Message 4 of 37

a9080109
Explorer
Explorer

I have implemented what is mentioned about flexsim

0 Likes
Message 5 of 37

julie_weller
Not applicable
What specific questions do you have now that you've looked at the tutorial?
0 Likes
Message 6 of 37

a9080109
Explorer
Explorer

@Kavika F

I just want to use this as a basis to make some extensions. For example, I want to know the py file about the training. I want to know how my neural network is written. Can you provide relevant information? Or Explain the logic of this py file a little bit

1689154577009.png

I understand the meaning of the picture but I don't understand what the overall training logic is

0 Likes
Message 7 of 37

kavika_faleumu
Autodesk
Autodesk
Hey @mark zhen, if you want to understand the logic of the training, you'll have to read the documentation posted by stable_baselines3. For example, the PPO documentation gives links to research papers on the algorithm and examples on how to use it.


The "MlpPolicy" is the first parameter of the PPO constructor, stating that it will use a Multi-layered Perceptron. The "env" is a FlexSimEnv, which is an OpenAI Gym Environment (which is the second parameter required by the constructor). The rest of the parameters are left to their default values (which can be found on the documentation) except for "verbose", which is set to 1 so you can see in the output console what's happening.

Message 8 of 37

a9080109
Explorer
Explorer

@Kavika F

So if I want to complete transfer learning or incremental learning, do you have a suggested way?

0 Likes
Message 9 of 37

kavika_faleumu
Autodesk
Autodesk
Those are two very different ways of training a RL model. It ultimately depends on what your end objective is.

If you're trying to train on a small data set and improve the model over time or if your target objective changes frequently, then incremental learning may work for you.

If you're trying to train your model on one environment then use it (and potentially train it) in a separate simulation or environment, then transfer learning would be what you want.


What is your desired objective? What problem are you trying to solve?

0 Likes
Message 10 of 37

a9080109
Explorer
Explorer

My current situation should require the establishment of incremental learning,allcombos-22-0-1.fsm

0 Likes
Message 11 of 37

kavika_faleumu
Autodesk
Autodesk

Well what problem are you trying to solve? Maybe that will help me understand how I could help you implement an incremental learning algorithm. I'm not an expert in RL, but I could try to help you get started with regards to FlexSim and RL.

0 Likes
Message 12 of 37

a9080109
Explorer
Explorer

@Kavika F @Felix Möhlmann

The problem I want to solve (these are all preset by me)

From my understanding incremental learning can be used to update the overall database,

Then I now have a trained agent and I want to perform a dynamic training (because the reinforcement learning we completed on flexsim is to send fixed data into py for training, right?)

But because it is a factory schedule, the orders for each day will be independent, which may require retraining. I want to solve this problem

The second problem to be solved is

There may be new or reduced products in my factory, then I may have to retrain the overall model, then I wonder if incremental learning can be used to solve my problem

0 Likes
Message 13 of 37

a9080109
Explorer
Explorer

@Kavika F Do you have any good ideas?

0 Likes
Message 14 of 37

a9080109
Explorer
Explorer

I've tried to make some changes to PY but it's not going very well, do you know what's wrong?flexsim_training.py

0 Likes
Message 15 of 37

kavika_faleumu
Autodesk
Autodesk
What kind of actions is your incremental model taking? When you build a RL model, it will have to examine the environment/state of the system and make informed decisions (actions) based on the state and rewards involved with those actions.


Are the model's actions assigning operators? Is it sending items to specific places?

0 Likes
Message 16 of 37

joerg_vogel_HsH
Mentor
Mentor
@Kavika F, please check all questions and threads of Mark Zhen. Perhaps you are able to find a satisfying answer for him, which other developers or users weren’t able to.
0 Likes
Message 17 of 37

a9080109
Explorer
Explorer

@Kavika F @Joerg Vogel

The problem I want to solve is this, but I don't have a good way to clarify all the details

Then I now have a trained agent and I want to perform a dynamic training (because the reinforcement learning we completed on flexsim is to send fixed data into py for training, right?)

But because it is a factory schedule, the orders for each day will be independent, which may require retraining. I want to solve this problem

I don't quite know what you mean, I can provide you with the field of my incremental learning application0326_autosave.fsm

0 Likes
Message 18 of 37

a9080109
Explorer
Explorer

@Kavika F @Joerg Vogel @Felix Möhlmann Is this problem very difficult to solve?

0 Likes
Message 19 of 37

kavika_faleumu
Autodesk
Autodesk

Hey @mark zhen, the model you've posted doesn't look setup for RL. It won't give you much value.

inlineprocessors.png

The Processors are in-line with fixed processing times and no setup times. From what I can tell, each item has to go through each processor once, in order (Polish > Slit > Cut > Pack). There is no action needed by a RL agent because the process will take the same amount of time regardless of what items get chosen in Queue1.

0 Likes
Message 20 of 37

a9080109
Explorer
Explorer

@Kavika F

I need to use rl for production scheduling, and the process of each product is different, so I just want to know how the best scheduling is performed

0 Likes