This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch | |
import torch.nn as nn | |
from torch.autograd import Variable | |
from collections import OrderedDict | |
import numpy as np | |
def check_same(stride): | |
if isinstance(stride, (list, tuple)): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: pytorch | |
channels: | |
- conda-forge | |
- pytorch | |
- nvidia | |
dependencies: | |
- pytorch::pytorch | |
- pytorch::torchvision |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
Created on Thu Apr 11 10:31:43 2019 | |
@author: Attila Lengyel | |
""" | |
import h5py | |
def read_hdf5(path): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
Created on Thu Feb 28 19:56:58 2019 | |
@author: Attila Lengyel | |
[email protected] | |
""" | |
import numpy as np | |
import os |