Skip to content

Instantly share code, notes, and snippets.

View max-kuk's full-sized avatar
🎓
Focusing

Max Kukuškin max-kuk

🎓
Focusing
View GitHub Profile
@max-kuk
max-kuk / global_convolution_tf.py
Last active October 20, 2022 14:03
The Global Convolution Network (GCN) Block is essentially a kx1 followed by 1xk convolution summed with a parallely computed 1xk followed by kx1 convolution. This results in a large kxk kernel with dense connections.
class GCN(tf.Module):
def __init__(self, filters, k=7):
super(GCN, self).__init__()
self.padding_l1 = tf.keras.layers.ZeroPadding2D(padding=((k - 1) // 2, 0))
self.conv_l1 = tf.keras.layers.Conv2D(filters, kernel_size=(k, 1))
self.padding_l2 = tf.keras.layers.ZeroPadding2D(padding=(0, (k - 1) // 2))
self.conv_l2 = tf.keras.layers.Conv2D(filters, kernel_size=(1, k))
self.padding_r1 = tf.keras.layers.ZeroPadding2D(padding=((k - 1) // 2, 0))
self.conv_r1 = tf.keras.layers.Conv2D(filters, kernel_size=(1, k))
# Copyright 2020 by Maksim Kukushkin, The Information Systems Institute, University of Leipzig.
# Weather crawler to collect weather data from Wunderground.com
# This file is part of the tools used
# for master thesis "Flight price prediction and Dynamic Pricing in European low-cost airlines"
import csv
import json
import time
from calendar import monthrange
@max-kuk
max-kuk / gradientboostingv3.ipynb
Created January 17, 2020 09:19
GradientBoostingV3.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@max-kuk
max-kuk / notebook2.ipynb
Last active December 18, 2019 10:38
Segment satellite images.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@max-kuk
max-kuk / segment-satellite-images.ipynb
Last active December 18, 2019 10:36
Compare predicted and original masks.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import torch
from collections import OrderedDict
from typing import List
checkpoints_weights_paths: List[str] = ... # sorted in descending order by score
model: torch.nn.Module = ...
def average_weights(state_dicts: List[dict]):
everage_dict = OrderedDict()