This file contains 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
CREATE OR REPLACE FUNCTION count_max_on_pos(date1 DATE, date2 DATE, id_pos INTEGER) RETURNS INTEGER AS $$ | |
-- date1, date2 - limits of the time interval | |
-- id_pos - id of the position we examine | |
DECLARE num_people_array INTEGER ARRAY; | |
DECLARE max_on_pos INTEGER := 0; | |
DECLARE curr_on_pos INTEGER := 0; | |
DECLARE i INTEGER; | |
BEGIN | |
SELECT ARRAY(SELECT coalesce(num_pos,0) - coalesce(num_neg,0) FROM |
This file contains 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
from keras.models import Sequential | |
model = Sequential() |
This file contains 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 CustomDataset(torch.utils.data.Dataset): | |
def __init__(self): | |
# TODO | |
# 1. Initialize file paths or a list of file names. | |
pass | |
def __getitem__(self, index): | |
# TODO | |
# 1. Read one data from file (e.g. using numpy.fromfile, PIL.Image.open). | |
# 2. Preprocess the data (e.g. torchvision.Transform). | |
# 3. Return a data pair (e.g. image and label). |
This file contains 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
""" | |
Sublime shortcuts for jupyter notebook | |
""" | |
from jupyter_core.paths import jupyter_config_dir | |
import os | |
custom_js_path = os.path.join(jupyter_config_dir(), 'custom', 'custom.js') | |
custom_path = os.path.join(jupyter_config_dir(), 'custom') | |
This file contains 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 | |
import torch.optim as optim | |
from torchvision.datasets.mnist import MNIST | |
import torchvision.transforms as transforms | |
from torch.utils.data import DataLoader | |
import visdom | |
from collections import OrderedDict | |
class LeNet5(nn.Module): |
This file contains 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.nn as nn | |
def conv3x3(in_planes, out_planes, stride=1): | |
"""3x3 convolution with padding""" | |
return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride, | |
padding=1, bias=False) | |
def conv1x1(in_planes, out_planes, stride=1): | |
"""1x1 convolution""" | |
return nn.Conv2d(in_planes, out_planes, kernel_size=1, stride=stride, bias=False) |
This file contains 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
#to match the word between foo and bar use: | |
$ grep -oP '(?<=foo )\w+(?= bar)' test.txt |
This file contains 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
#!/bin/bash | |
# 1. create a bot using @BotFather | |
# 2. create a public channel, add the bot as it's administrator | |
# 3. fill in the required information below | |
# 4. do a test run. In the response there will be a chat_id, which is a bunch of numbers | |
# now it's possible to make the channel private and use chat_id instead of the public name | |
bot_token=#YOUR_BOT_TOKEN | |
chat_id=#UR_CHANNEL_ID | |
api_call="https://api.telegram.org/bot$bot_token/sendMessage" |
This file contains 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
diff --git a/tensorflow/lite/kernels/internal/BUILD b/tensorflow/lite/kernels/internal/BUILD | |
index 4be3226938..6bc39a7194 100644 | |
--- a/tensorflow/lite/kernels/internal/BUILD | |
+++ b/tensorflow/lite/kernels/internal/BUILD | |
@@ -37,6 +37,18 @@ NEON_FLAGS_IF_APPLICABLE = select({ | |
], | |
}) | |
+cc_library( | |
+ name = "common", |
This file contains 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
/* | |
parameter JSON | |
{ | |
"num_layers": 5, | |
"min_scale": 0.1171875, | |
"max_scale": 0.75, | |
"input_size_height": 256, | |
"input_size_width": 256, | |
"anchor_offset_x": 0.5, | |
"anchor_offset_y": 0.5, |
OlderNewer