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
"""clip filter is a tool to use a knn index and a image/text collection to extract interesting subsets""" | |
# updated it for handling webdataset tar files | |
import fire | |
import boto3 | |
import os, sys | |
from botocore.exceptions import ClientError | |
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 random | |
import time | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from copy import deepcopy | |
from controller.controller import Controller # hardware control code | |
from vizdoom import DoomGame, Button, GameVariable, ScreenFormat, ScreenResolution, AutomapMode |
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 "zcommon.acs" | |
#define KILL_REWARD 100.0 | |
#define EXIT_REWARD 500.0 | |
// these variables are exposed to ViZDoom | |
global int 0:reward; | |
global int 1:killCount; // number of monsters killed | |
global int 2:xpos; // player's position |
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
while y > 6: | |
if y == 5: | |
x += y*2 | |
if x < 42: | |
x += y*3 |
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
ProfStart('output.prof') | |
# ... Python code that calls C extension you intend to profile ... | |
ProfFlush() | |
ProfStop() |
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 distutils.core import setup | |
from Cython.Build import cythonize | |
setup( | |
name = 'gperftools_wrapped', | |
ext_modules = cythonize("gperftools_wrapped.pyx"), | |
) |
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
cdef extern from "gperftools/profiler.h": | |
int ProfilerStart(char* fname) | |
void ProfilerStop() | |
void ProfilerFlush() | |
def ProfStart(fname): | |
return ProfilerStart(fname) | |
def ProfStop(): | |
ProfilerStop() |
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
function feature = alpha_feature(EEG) | |
% constants | |
alpha = 7 : 12; | |
left_channels = 1 : 4; | |
right_channels = 11 : 14; | |
% left mean alpha power for every channel | |
left_alpha_power_avg = 0; | |
for chan = left_channels |