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 numpy as np | |
X = np.array([ | |
[1, 1], | |
[1.5, 0], | |
[3, 3] | |
], dtype=np.float) | |
y = np.array([1, 2, 3], dtype=np.float) |
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
#include <iostream> | |
#include <xmmintrin.h> | |
void foo(const float num, const float denom) | |
{ | |
typedef __v4sf Vec4; | |
//typedef __m128 Vec4; | |
const Vec4 num4 = { | |
num, |
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
name: "WFLW_wo_mp" | |
# data ------------------------------------ | |
input: "data" | |
input_shape { | |
dim: 1 | |
dim: 1 | |
dim: 256 | |
dim: 256 |
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 cv2 | |
import torch | |
import torch.nn.functional as F | |
import scipy | |
import numpy as np | |
def draw_circle(canvas, point, radius): | |
cv2.circle(canvas, (int(round(point[0])), int(round(point[1]))), radius, color=255, thickness=-1) |
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 cv2 | |
import torch | |
import torch.nn.functional as F | |
import scipy | |
import numpy as np | |
def theta_for_patch_center(img_shape, window_size, patch_center): | |
theta = torch.FloatTensor([[ | |
[window_size[0] / img_shape[0], 0, 2 * patch_center[0] / (img_shape[0] - 1) - 1], |
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 albumentations as albu | |
def download_image(url): | |
data = urlopen(url).read() | |
data = np.frombuffer(data, np.uint8) | |
image = cv2.imdecode(data, cv2.IMREAD_COLOR) | |
return image | |
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 sys | |
import collections | |
import torch | |
import torch.nn as nn | |
import torch.nn.functional as F | |
import torchvision | |
import torchvision.transforms as transforms | |
import catalyst | |
from catalyst.dl.callbacks import ( |
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 __future__ import print_function | |
import argparse | |
import os | |
import sys | |
import random | |
import warnings | |
import ignite | |
import torch |
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 __future__ import print_function | |
import argparse | |
import os | |
import sys | |
import random | |
import warnings | |
import ignite | |
import torch |
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 numpy as np | |
import torch | |
class MySquare(torch.autograd.Function): | |
@staticmethod | |
def forward(ctx, input): | |
print('forward call') | |
ctx.save_for_backward(input) | |
return input * input |
NewerOlder