Skip to content

Instantly share code, notes, and snippets.

@kir486680
kir486680 / Solution.py
Last active January 31, 2022 23:00
Solution to the DroneDeploy problem 1
import random, math
#---helper functions
def is_conflicting_points(point1, point2):
# compare x axis
if abs(point1.x - point2.x) > CONFLICT_RADIUS: return False
# compare y axis
elif abs(point1.y - point2.y) > CONFLICT_RADIUS: return False
# box compare
elif abs(point1.x - point2.x) <= conflicting_box_size and abs(point1.y - point2.y) <= conflicting_box_size: return True
@kir486680
kir486680 / convlstm.py
Created February 13, 2021 14:29
ConvLSTM
class ConvLSTMCell(nn.Module):
def __init__(self, input_size, input_dim, hidden_dim, kernel_size, bias):
"""
Initialize ConvLSTM cell.
Parameters
----------
input_size: (int, int)
Height and width of input tensor as (height, width).