online-ml / deep-river

https://online-ml.github.io/deep-river/
BSD 3-Clause "New" or "Revised" License
108 stars 10 forks source link

multiple inputs and multiple predicted outputs #90

Closed panchao12345 closed 2 months ago

panchao12345 commented 4 months ago

Is it possible for deep-river to take multiple inputs to a learned model and output multiple predicted outputs? For example tensorflow1 of the form model_output = self.sess.run([self.curr_nn_output], feeddict={self.x: inputs_list}),where inputs_list and model_output are 2-dimensional lists .

kulbachcedric commented 4 months ago

Hi @panchao12345

deep-river only supports PyTorch as PyTorch is much faster in adapting the underlying architecture in an online manner and when it come to iterative learning. the river API supports multiple inputs as well as multiple output.

Best Cedric

panchao12345 commented 4 months ago

@kulbachcedric Thank you very much for your reply. This code runs a TensorFlow session to process a 2D input array using the current neural network model. Each row of the input array represents a separate input sample, and the model generates one output for each row simultaneously. The results are stored in the model_output variable. Could deep-river implement this functionality without using predict_one() to perform loop iteration? Because the loop iteration of predict_one() takes a lot of time.

kulbachcedric commented 4 months ago

Hi @panchao12345 Unfortunately tensor flow is not supported within deep-river. However, the input needs to follow the river API in the sense that it needs to be a flat dictionary. If I understood correctly this is the case in your scenario. The deep-river has also the predict_many method that predicts on many instances in a much more efficient way.

Best Cedric