def evalRnnOnSeqDataset(net, DS, verbose=False, silent=False):
 r = 0.0
 samples = 0.0
 for seq in DS:
  net.reset()
  for (i, t) in seq:
   res = net.activate(i)
   if verbose:
    print(t, res)
   r += sum(((t - res) ** 2))
   samples += 1
  if verbose:
   print(('-' * 20))
 r /= samples
 if (not silent):
  print('MSE:', r)
 return r

def evalRnnOnSeqDataset ( net , DS , verbose = False , silent = False ) : r = 0.0 samples = 0.0 for seq in DS : net . reset ( ) for ( i , t ) in seq : res = net . activate ( i ) if verbose : print ( t , res ) r += sum ( ( ( t - res ) ** 2 ) ) samples += 1 if verbose : print ( ( '-' * 20 ) ) r /= samples if ( not silent ) : print ( 'MSE:' , r ) return r
evaluate the network on all the sequences of a dataset .