  We present a novel method to produce empirical generative models of all kinds
of astronomical transients from datasets of unlabeled light curves. Our hybrid
model, that we call ParSNIP, uses a neural network to model the unknown
intrinsic diversity of different transients and an explicit physics-based model
of how light from the transient propagates through the universe and is
observed. The ParSNIP model predicts the time-varying spectra of transients
despite only being trained on photometric observations. With a
three-dimensional intrinsic model, we are able to fit out-of-sample multiband
light curves of many different kinds of transients with model uncertainties of
0.04-0.06 mag. The representation learned by the ParSNIP model is invariant to
redshift, so it can be used to perform photometric classification of transients
even with heavily biased training sets. Our classification techniques
significantly outperform state-of-the-art methods on both simulated (PLAsTiCC)
and real (PS1) datasets with 2.3$\times$ and 2$\times$ less contamination
respectively for classification of Type~Ia supernovae. We demonstrate how our
model can identify previously-unobserved kinds of transients and produce a
sample that is 90% pure. The ParSNIP model can also estimate distances to Type
Ia supernovae in the PS1 dataset with an RMS of 0.150 $\pm$ 0.007 mag compared
to 0.155 $\pm$ 0.008 mag for the SALT2 model on the same sample. We discuss how
our model could be used to produce distance estimates for supernova cosmology
without the need for explicit classification.
