def _hash(self, regularizers=()):
        def add(s):
            h.update(str(s).encode('utf-8'))
        h = hashlib.md5()
        for l in self.layers:
            add('{}{}{}'.format(l.__class__.__name__, l.name, l.size))
        for l in self.losses:
            add('{}{}'.format(l.__class__.__name__, l.weight))
        for r in regularizers:
            add('{}{}{}'.format(r.__class__.__name__, r.weight, r.pattern))
        return h.hexdigest()
open fname for writing, clearing it out if it exists
dataset/ETHPy150Open lmjohns3/theanets/theanets/graph.py/Network._hash--crossover with--dataset/ETHPy150Open uci-cbcl/tree-hmm/gmtkParam/obsIO.py/GmtkBinaryObsOutStream.__init__