Skip to content

Instantly share code, notes, and snippets.

import numpy as np
from random import randint
import tensorflow as tf
from tensorflow.keras.layers import Input, LSTM, RepeatVector, TimeDistributed, Dense
from functools import lru_cache
import time
NUM_SERIES = 1000
TRAIN_SET_SIZE = 1000
import re
import os
from typing import Dict, Tuple, List
import sys
import shutil
from argparse import ArgumentParser
def group_file_names(d: str) -> Dict[str, List[Tuple[str, str]]]:
"""
# based on: https://www.learnopencv.com/rotation-matrix-to-euler-angles/
import numpy as np
import math
def is_rotmat(r) :
ident = np.identity(3, dtype=r.dtype)
r2 = np.dot(np.transpose(r), r)
return np.linalg.norm(ident - r2) < 1e-6