Resumen: We develop inductive biases for the machine learning of complex physical systems based on the port-Hamiltonian formalism. To satisfy by construction the principles of thermodynamics in the learned physics (conservation of energy, non-negative entropy production), we modify accordingly the port-Hamiltonian formalism so as to achieve a port-metriplectic one. We show that the constructed networks are able to learn the physics of complex systems by parts, thus alleviating the burden associated to the experimental characterization and posterior learning process of this kind of systems. Predictions can be done, however, at the scale of the complete system. Examples are shown on the performance of the proposed technique. Idioma: Inglés DOI: 10.1007/s00466-023-02296-w Año: 2023 Publicado en: COMPUTATIONAL MECHANICS 72, 3 (2023), 553–561 ISSN: 0178-7675 Factor impacto JCR: 3.7 (2023) Categ. JCR: MATHEMATICS, INTERDISCIPLINARY APPLICATIONS rank: 13 / 135 = 0.096 (2023) - Q1 - T1 Categ. JCR: MECHANICS rank: 33 / 170 = 0.194 (2023) - Q1 - T1 Factor impacto CITESCORE: 7.8 - Applied Mathematics (Q1) - Computational Mathematics (Q1) - Mechanical Engineering (Q1) - Computational Mechanics (Q1) - Ocean Engineering (Q1) - Computational Theory and Mathematics (Q1)