Skip to content

Instantly share code, notes, and snippets.

@rindis
rindis / gist:2e8ebcbcd26de3432e86355c50c4e5ea
Created October 26, 2021 16:15
Python multiple inheritance with dataclasses
from dataclasses import dataclass
@dataclass
class A(object):
a: str
@dataclass
class B(A):
@rindis
rindis / gist:3226257d7f18121fe41c093cdde117a5
Last active October 26, 2021 16:16
Python multiple inheritance no dataclasses
class A(object):
def __init__(self, a):
self.a = a
class B(A):
def __init__(self, b, **kw):
self.b = b
super().__init__(**kw)
@rindis
rindis / fit_issue.py
Last active January 18, 2021 15:12
Issue running fit() on several sequential keras models in the same script
import os
import random
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import tensorflow as tf
import tensorflow.keras as keras
from matplotlib.lines import Line2D
from sklearn.model_selection import train_test_split