This file contains hidden or 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 os | |
| import multiprocessing | |
| import torch | |
| import torch.nn.functional as F | |
| import torchmetrics | |
| import pytorch_lightning as pl | |
| from argparse import ArgumentParser | |
| from torch import nn |
This file contains hidden or 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
| """ | |
| Created on Sat Sep 28 00:47:38 2019 | |
| @author: Kenan Kilictepe (Entegral / www.entegral.com.tr) | |
| """ | |
| import numba | |
| from numba import cuda | |
| import numpy as np | |
| from pdb import set_trace |
This file contains hidden or 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 a simple convnet on the MNIST dataset. | |
| Gets to 99.25% test accuracy after 12 epochs | |
| (there is still a lot of margin for parameter tuning). | |
| 16 seconds per epoch on a GRID K520 GPU. | |
| ''' | |
| import keras | |
| from keras.datasets import mnist | |
| from keras.models import Sequential |
This file contains hidden or 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
| /* | |
| Check SSE/AVX support. | |
| This application can detect the instruction support of | |
| SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, SSE4a, SSE5, and AVX. | |
| grep avx /proc/cpuinfo | |
| g++ ssecheck.cpp -o ssecheck | |
| */ | |
| #include <iostream> | |
| #ifdef _MSC_VER |
This file contains hidden or 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 | |
| print(torch.cuda.current_device()) | |
| # 0 | |
| print(torch.cuda.device(0)) | |
| # <torch.cuda.device at 0x...> | |
| print(torch.cuda.device_count()) | |
| # 1 |
This file contains hidden or 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 tensorflow as tf | |
| import numpy as np | |
| import time | |
| from tensorflow.contrib.rnn import BasicLSTMCell | |
| # https://github.com/tensorflow/tensorflow/issues/24828 | |
| try: | |
| from tensorflow.compat.v1 import ConfigProto | |
| from tensorflow.compat.v1 import InteractiveSession |
This file contains hidden or 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 os, json, shutil | |
| import keras | |
| from keras.callbacks import TensorBoard | |
| from keras.datasets import cifar10 | |
| from keras.preprocessing.image import ImageDataGenerator | |
| from keras.models import Sequential | |
| from keras.layers import Dense, Dropout, Activation, Flatten | |
| from keras.layers import Conv2D, MaxPooling2D |
This file contains hidden or 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
| netsh wlan show profiles | |
| netsh wlan show profile name=profilename key=clear |
This file contains hidden or 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/sh | |
| # MacOS Mojave | |
| brew install qemu | |
| export QEMU=$(which qemu-system-arm) | |
| export TMP_DIR=~/tmp/qemu-rpi | |
| export RPI_KERNEL=${TMP_DIR}/kernel-qemu-4.14.79-stretch | |
| export RPI_FS=${TMP_DIR}/2018-11-13-raspbian-stretch-lite.img |
This file contains hidden or 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 | |
| sudo kextunload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport | |
| sudo kextload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport |