  We introduce a machine-learning density-functional-theory formalism for the
spinless Hubbard model in one dimension at both zero and finite temperature. In
the zero-temperature case this establishes a one-to-one relation between the
site occupation and the total energy, which is then minimised at the
ground-state occupation. In contrast, at finite temperature the same relation
is defined between the Helmholtz free energy and the equilibrium site
occupation. Most importantly, both functionals are semi-local, so that they are
independent from the size of the system under investigation and can be
constructed over exact data for small systems. These 'exact' functionals are
numerically defined by neural networks. We also define additional neural
networks for finite-temperature thermodynamical quantities, such as the entropy
and heat capacity. These can be either a functional of the ground-state site
occupation or of the finite-temperature equilibrium site occupation. In the
first case their equilibrium value does not correspond to an extremal point of
the functional, while it does in the second case. Our work gives us access to
finite-temperature properties of many-body systems in the thermodynamic limit.
