Skip to content

Instantly share code, notes, and snippets.

View davidclarance's full-sized avatar
🐦
birding

David Clarance davidclarance

🐦
birding
  • M-KOPA
  • Nairobi, Kenya
View GitHub Profile
@sainathadapa
sainathadapa / glimpse.py
Last active December 19, 2023 15:33
glimpse-python
def glimpse(df, maxvals=10, maxlen=110):
print('Shape: ', df.shape)
def pad(y):
max_len = max([len(x) for x in y])
return [x.ljust(max_len) for x in y]
# Column Name
toprnt = pad(df.columns.tolist())
@matttrent
matttrent / list_rate_schedule.py
Last active October 25, 2019 07:04
Keras list of learning rates schedule
def list_rate_schedule(lrates, output=True):
sched = []
last_lr = [0]
for lr, n in lrates:
sched += [lr] * n
def lr_sched(epoch):
lr = sched[-1]
if epoch < len(sched):