Include safety for NaN or Inf in nodes and weights