Skip to content

Instantly share code, notes, and snippets.

class ConvLSTM(nn.Module):
'''
LSTM module working with convolutional gates
'''
def __init__(self, fx, fh):
super(LSTM, self).__init__()
self.g_input = nn.Conv2d(fx + fh, fh, 3, padding=1)
self.g_forget = nn.Conv2d(fx + fh, fh, 3, padding=1)
self.g_cell = nn.Conv2d(fx + fh, fh, 3, padding=1)
@jatentaki
jatentaki / localized.py
Created September 19, 2018 09:52
Localized errors in PyTorch
class LocalizedException(Exception):
pass
def localized(method):
''' Adds module name to traceback '''
def wrapped(self, *args, **kwargs):
try:
return method(self, *args, **kwargs)
except Exception as e:
@jatentaki
jatentaki / stderr
Created October 8, 2016 20:02
cmake output with OpenCV_FOUND set to 1
/home/jatentaki/Programs/mrowki2/CMakeLists.txt(1): cmake_minimum_required(VERSION 2.8 )
/home/jatentaki/Programs/mrowki2/CMakeLists.txt(2): project(DisplayImage )
/home/jatentaki/Programs/mrowki2/CMakeFiles/3.5.1/CMakeSystem.cmake(1): set(CMAKE_HOST_SYSTEM Linux-4.4.0-38-generic )
/home/jatentaki/Programs/mrowki2/CMakeFiles/3.5.1/CMakeSystem.cmake(2): set(CMAKE_HOST_SYSTEM_NAME Linux )
/home/jatentaki/Programs/mrowki2/CMakeFiles/3.5.1/CMakeSystem.cmake(3): set(CMAKE_HOST_SYSTEM_VERSION 4.4.0-38-generic )
/home/jatentaki/Programs/mrowki2/CMakeFiles/3.5.1/CMakeSystem.cmake(4): set(CMAKE_HOST_SYSTEM_PROCESSOR x86_64 )
/home/jatentaki/Programs/mrowki2/CMakeFiles/3.5.1/CMakeSystem.cmake(8): set(CMAKE_SYSTEM Linux-4.4.0-38-generic )
/home/jatentaki/Programs/mrowki2/CMakeFiles/3.5.1/CMakeSystem.cmake(9): set(CMAKE_SYSTEM_NAME Linux )
/home/jatentaki/Programs/mrowki2/CMakeFiles/3.5.1/CMakeSystem.cmake(10): set(CMAKE_SYSTEM_VERSION 4.4.0-38-generic )
/home/jatentaki/Programs/mrowki2/CMakeFiles/3.5.1/CMakeSys
@jatentaki
jatentaki / stderr
Created October 8, 2016 19:58
cmake output
/home/jatentaki/Programs/mrowki2/CMakeLists.txt(1): cmake_minimum_required(VERSION 2.8 )
/home/jatentaki/Programs/mrowki2/CMakeLists.txt(2): project(DisplayImage )
/home/jatentaki/Programs/mrowki2/CMakeFiles/3.5.1/CMakeSystem.cmake(1): set(CMAKE_HOST_SYSTEM Linux-4.4.0-38-generic )
/home/jatentaki/Programs/mrowki2/CMakeFiles/3.5.1/CMakeSystem.cmake(2): set(CMAKE_HOST_SYSTEM_NAME Linux )
/home/jatentaki/Programs/mrowki2/CMakeFiles/3.5.1/CMakeSystem.cmake(3): set(CMAKE_HOST_SYSTEM_VERSION 4.4.0-38-generic )
/home/jatentaki/Programs/mrowki2/CMakeFiles/3.5.1/CMakeSystem.cmake(4): set(CMAKE_HOST_SYSTEM_PROCESSOR x86_64 )
/home/jatentaki/Programs/mrowki2/CMakeFiles/3.5.1/CMakeSystem.cmake(8): set(CMAKE_SYSTEM Linux-4.4.0-38-generic )
/home/jatentaki/Programs/mrowki2/CMakeFiles/3.5.1/CMakeSystem.cmake(9): set(CMAKE_SYSTEM_NAME Linux )
/home/jatentaki/Programs/mrowki2/CMakeFiles/3.5.1/CMakeSystem.cmake(10): set(CMAKE_SYSTEM_VERSION 4.4.0-38-generic )
/home/jatentaki/Programs/mrowki2/CMakeFiles/3.5.1/CMakeSys