Skip to content

Instantly share code, notes, and snippets.

View robgrzel's full-sized avatar

Robert Grzelka robgrzel

  • Sweden, Gotheborg
View GitHub Profile
@robgrzel
robgrzel / py36tf.yml
Created November 25, 2018 23:39
Miniconda3, python3.6, tensorflow with GPU for cuda 9.1
name: py36tf
channels:
- engility
- conda-forge
- defaults
dependencies:
- attrs=18.2.0=py_0
- backcall=0.1.0=py_0
- bleach=3.0.2=py_0
- decorator=4.3.0=py_0
@robgrzel
robgrzel / condaenv.txt
Created November 13, 2018 00:05 — forked from pratos/condaenv.txt
To package a conda environment (Requirement.txt and virtual environment)
# For Windows users# Note: <> denotes changes to be made
#Create a conda environment
conda create --name <environment-name> python=<version:2.7/3.5>
#To create a requirements.txt file:
conda list #Gives you list of packages used for the environment
conda list -e > requirements.txt #Save all the info about packages to your folder
@robgrzel
robgrzel / training_set.csv
Created October 7, 2018 22:08
FFR135 HW2.4 DQL
-0.73481 0.46286 -1
-0.71797 -0.27961 -1
-0.36226 0.43877 -1
0.16178 0.66627 -1
0.75976 0.93611 -1
0.47294 0.74 -1
0.45301 0.60238 -1
-0.15869 -0.48386 -1
0.35195 -0.19585 -1
0.60033 -0.57328 -1
@robgrzel
robgrzel / training_set.csv
Last active September 21, 2018 13:23
FFR135 HW2.3
-0.71797 -0.27961 -1
-0.36226 0.43877 -1
0.16178 0.66627 -1
0.75976 0.93611 -1
0.47294 0.74 -1
0.45301 0.60238 -1
-0.15869 -0.48386 -1
0.35195 -0.19585 -1
0.60033 -0.57328 -1
@robgrzel
robgrzel / main.cpp
Created August 1, 2018 19:51 — forked from eulersson/main.cpp
Thrust + CUDA kernel
#include <iostream>
#include <iomanip>
#include <cstdlib>
#include <thrust/device_vector.h>
/*
* --- Using Thrust vectors in kernel functions ---
* This example demonstrates how we can use device vectors (vectors that live
* in GPU) as arguments to a kernel launched by the CPU.
//
// onehiddenlayerperceptron.cu
// onehiddenlayerperceptron
//
// Created by Sergei Bugrov on 8/21/17.
// Copyright © 2017 Sergei Bugrov. All rights reserved.
//
#include <stdio.h>
@robgrzel
robgrzel / cudnn_convolution_forward.cu
Created July 23, 2018 10:58 — forked from odashi/cudnn_convolution_forward.cu
Example usage of cuDNN convolution forward functions.
#include <iomanip>
#include <iostream>
#include <cstdlib>
#include <vector>
#include <cuda.h>
#include <cudnn.h>
#define CUDA_CALL(f) { \
cudaError_t err = (f); \
@robgrzel
robgrzel / gist:d1e79721a898f721bcd279d107663c8b
Created July 22, 2018 16:31 — forked from AndrewScheidecker/gist:930f4a6e0966b8421806
A stupid C++ trick for defining structs with metadata (serializers, printers, etc) without redundant declarations of members
#include <iostream>
#include <vector>
#include <string>
using std::string;
/*
These macros define a struct with an implicitly defined Show function that visits each member.
The trick is that a typedef is split between each STRUCT_MEMBER instance and the preceding macro,
which allows it to define an empty struct type that identifies the following struct member, while also
knowing the struct type that the preceding macro is using to identify the current member.
@robgrzel
robgrzel / conv.cu
Created July 19, 2018 18:27 — forked from goldsborough/conv.cu
Convolution with cuDNN
#include <cudnn.h>
#include <cassert>
#include <cstdlib>
#include <iostream>
#include <opencv2/opencv.hpp>
#define checkCUDNN(expression) \
{ \
cudnnStatus_t status = (expression); \
if (status != CUDNN_STATUS_SUCCESS) { \
@robgrzel
robgrzel / debian-install-zram.sh
Created July 7, 2018 11:40
Install zRAM on Debian(8)
#!/bin/bash
#
not_root() {
echo "ERROR: You have to be root to execute this script"
exit 1
}
zram_exists() {
echo "ERROR: /etc/init.d/zram already exists"