in containers/Shoot/CNN/train.py [0:0]
def create_board(record, team, DTYPE):
layout = nd.array(record[team]["layout"])
out = []
board = nd.zeros((2, layout.shape[0], layout.shape[1]))
mask = nd.ones((layout.shape[0], layout.shape[1]))
for i in range(len(record[team]["shots"])):
if i > 10:
x = random.randint(0, layout.shape[0] - 1)
y = random.randint(0, layout.shape[1] - 1)
result = 0 if layout[x][y].asscalar() == 1 else 1
board[result][x][y] = 1
mask[x][y] = 0
out.append([
board.copy().astype(DTYPE),
layout.astype(DTYPE),
mask.astype(DTYPE)
])
return out