  We derive distances and masses of stars from the Sloan Digital Sky Survey
(SDSS) Apache Point Observatory Galactic Evolution Experiment (APOGEE) Data
Release 17 (DR17) using simple neural networks. Training data for distances
comes from Gaia EDR3, supplemented by literature distances for star clusters.
For masses, the network is trained using asteroseismic masses for evolved stars
and isochrone masses for main sequence stars. The models are trained on
effective temperature, surface gravity, metallicity and carbon and nitrogen
abundances. We found that our distance predictions have median fractional
errors that range from $\approx 20\%$ at low log g and $\approx 10\%$ at higher
log g with a standard deviation of $\approx 11\%$. The mass predictions have a
standard deviation of $\pm 12\%$. Using the masses, we derive ages for evolved
stars based on the correspondence between mass and age for giant stars given by
isochrones. The results are compiled into a Value Added Catalog (VAC) called
DistMass that contains distances and masses for 733901 independent spectra,
plus ages for 396548 evolved stars.
