Simple turing machine made in python The sample automata accepts strings from: L = {a^n . b^(2n) : n >= 1}
Example: abb (accepts) aabbbb (accepts) aab (don't accept)
Simple turing machine made in python The sample automata accepts strings from: L = {a^n . b^(2n) : n >= 1}
Example: abb (accepts) aabbbb (accepts) aab (don't accept)
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| class HeniNet: | |
| def __init__(self, layers, lr=0.001, epochs=1000): | |
| self.X = None | |
| self.Y = None | |
| self.layers = layers | |
| self.lr = lr | |
| self.epochs = epochs |
| #! /usr/bin/python3 | |
| import sys | |
| inf = sys.stdin.buffer | |
| data = [] | |
| byte = '' | |
| # Read data from file in blocks of 16 bytes | |
| # Python >= 3.8 |