Optimal Decoding of Cellular Identities in a Genetic Network