Skip to content

Instantly share code, notes, and snippets.

Avatar

Attila Lengyel Attila94

View GitHub Profile
@Attila94
Attila94 / pytorch.yml
Last active Dec 10, 2021
Default PyTorch conda environment for TU Delft HPC.
View pytorch.yml
name: pytorch
channels:
- conda-forge
- pytorch
dependencies:
- python=3.7.7
- pytorch::pytorch=1.7.0
- pytorch::torchvision=0.8.1
@Attila94
Attila94 / es_mintarget.py
Last active Jun 6, 2019
Keras Early Stopping callback with minimum target to reach before starting to monitor target value.
View es_mintarget.py
class MyEarlyStopping(EarlyStopping):
def __init__(self, minimum_target=None, **kwargs):
self.minimum_target = minimum_target
super(MyEarlyStopping, self).__init__(**kwargs)
def on_epoch_end(self, epoch, logs):
current = logs.get(self.monitor)
if self.minimum_target and self.monitor_op(self.minimum_target, current):
super(MyEarlyStopping, self).on_epoch_end(epoch, logs)
@Attila94
Attila94 / cropExDark.py
Created May 30, 2019
Make 96*96 square crops from bounding boxes of ExDark dataset.
View cropExDark.py
# -*- coding: utf-8 -*-
"""
Created on Tue Apr 9 14:33:10 2019
Make 96*96 square crops from bounding boxes of ExDark dataset.
@author: Attila Lengyel
"""
import numpy as np
@Attila94
Attila94 / read_hdf5.py
Last active Feb 27, 2022
Function to read saved Keras (tensorflow) weights from hdf5 file. Returns dict of layer names and weights.
View read_hdf5.py
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 11 10:31:43 2019
@author: Attila Lengyel
"""
import h5py
def read_hdf5(path):
@Attila94
Attila94 / log2xyz.py
Created Mar 25, 2019
Extract atom coordinates from Gaussian .log file and compute covergence
View log2xyz.py
# -*- coding: utf-8 -*-
"""
Created on Thu Feb 28 19:56:58 2019
@author: Attila Lengyel
attila@lengyel.nl
"""
import numpy as np
import os