Closed TanapongAUS closed 2 years ago
Hi @TanapongAUS,
Can you upload a minimal example code to reproduce the problem?
I modified the code, to use it with CSV files which everything has been done. Except passing the observation space as dictionary through the DQN Keras model. I was trying to do as the following link which you can understand it easily:
https://gist.github.com/bklebel/e3bd43ce228a53d27de119c639ac61ee
But, it did not work for me.
please tell me the solution. thanks in advance
I have tried many time and method for this. I have writen the code below, could you please check for me whether I have done something wrong. In this case I left only this 2 informations for the experiment
model_balance = Sequential() model_balance.add(Flatten(input_shape=(1,1,1), name='balance')) model_balance_input = Input(shape=(1,1), name='balance') model_balance_encoded = model_balance(model_balance_input)
model_equity = Sequential() model_equity.add(Flatten(input_shape=(1,1,1), name='equity')) model_equity_input = Input(shape=(1,1), name='equity') model_equity_encoded = model_Equity(model_equity_input)
con = concatenate([model_Balance_encoded, model_Equity_encoded])
dense = Dense(1024, activation='relu')(con) dense = Dense(1024, activation='relu')(dense) output = Dense(actions, activation='softmax')(dense)
model = Model(inputs=[model_Balance_input, model_Equity_input], outputs=output)
memory = SequentialMemory(limit=2000000, window_length=1) policy = LinearAnnealedPolicy(EpsGreedyQPolicy()) dqn = DQNAgent(model=model, policy=policy, nb_actions=actions, memory=memory)
dqn.processor = MultiInputProcessor(2)
dqn.compile( optimizer = Adam(learning_rate=1e-4), metrics = ['mse'] #'accuracy', 'mae')
dqn.fit(env, nb_steps=1000, verbose=1, visualize=False,)
==================================================================== Then, this problem occured, and I could not find the error.![9966](https://user-images.githubusercontent.com/99137527/157936724-0d49e221-ea5d-4d6c-945a-3dafef3dcc10.png)
please tell me the solution. thanks in advance