Hello channel :wave: Let's say I have two pipelin...
# questions
m
Hello channel 👋 Let's say I have two pipelines: • train pipeline A requires images and text as input, and outputs two models (encoder and decoder). • train pipeline B requires images only and outputs one model. The pipelines are part of the same project, though they focus on creating models for solving different tasks. I am thinking whether it could be possible to define one modular pipeline only that can accept either images, text, or a combination of both and output a variable number of models and use it both in A and B. I am following this intuition, as I have been trying to reduce code duplicate and create as many reusable components as possible. Would that work in Kedro, and would that follow Kedro style and principles?
👀 1
n
Hi @mattia.paterna, let me check if I understand this correctly. So Kedro's pipeline is usually "static", in the sense that before any nodes is executed, the structure of the DAGs should be determined already. Rather than thinking of passing input/output, the way I see this is: • You have a pipeline that can train model A • You have a pipeline that can train model B • You have a pipeline that is A + B • Depending on the inputs, you trigger only A, or only B or both One thing that maybe useful is that Pipeline is just a set of nodes, and you can do arithmetic. i.e. pipeline_a = node_a + node_b pipeline_b = node_b + node_c
pipeline_a + pipeline_b = {node_a, node_b, node_c}