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
""" Trains an agent with (stochastic) Policy Gradients on Pong. Uses OpenAI Gym. """ | |
import numpy as np | |
import cPickle as pickle | |
import gym | |
from chainer import cuda | |
import cupy as cp | |
import time, threading | |
#backend |
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
#!/usr/bin/python | |
# torch_bilateral: bi/trilateral filtering in torch | |
import torch | |
from torch import nn | |
from torch.autograd import Variable | |
import torch.nn.functional as F | |
from torch.nn import Parameter | |
import numpy as np | |
import pdb | |
import time |
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
#!/usr/bin/python | |
# torch_bilateral: bi/trilateral filtering in torch | |
import torch | |
from torch import nn | |
from torch.autograd import Variable | |
import torch.nn.functional as F | |
from torch.nn import Parameter | |
import numpy as np | |
import pdb | |
import time |
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
#!/usr/bin/python | |
# torch_bilateral: bi/trilateral filtering in tf | |
# Copyright: (c) 2017-2018 Prophesee | |
from __future__ import print_function | |
import tensorflow as tf | |
import numpy as np | |
import pdb | |
import time | |
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 glob | |
import sys | |
import time | |
import multiprocessing as mp, numpy as np, random | |
from prophesee_utils.td_video import ChronoVideo | |
import prophesee_utils.td_processing as tdp | |
import prophesee_utils.vis_utils as vis | |
import cv2 | |
from numba import njit as jit |
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
# pylint: disable-all | |
from __future__ import print_function | |
import torch | |
import random | |
import math | |
import torch | |
import torch.nn as nn | |
import torch.nn.functional as F | |
from box import box_iou, box_clamp | |
import numpy as np |
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
#!/usr/bin/python | |
# This script runs a random 3d animation & can retrieve: | |
# - detection | |
# - flow | |
# - zbuffer | |
# | |
# Copyright: (c) 2017-2018 Chronocam | |
import numpy as np | |
import cv2 |
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 division | |
import time | |
import numpy as np | |
class Timing: | |
def __init__(self): | |
self.total = 0 | |
self.ncalls = 0 | |
self.nevents = 0 | |
self.last_num = -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 torch | |
import torch.nn as nn | |
import torch.nn.functional as F | |
import math | |
import time | |
def timeit(x, func, iter=10): | |
torch.cuda.synchronize() | |
start = time.time() |
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
# pylint: disable-all | |
import torch.nn as nn | |
from torch.nn import functional as F | |
import torch | |
def time_to_batch(x): | |
t, n = x.size()[:2] | |
x = x.view(n * t, *x.size()[2:]) | |
return x, n |
OlderNewer