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 | |
# Define colors and styling | |
RED='\e[1;31m' | |
GREEN='\e[1;32m' | |
BLUE='\e[1;34m' | |
YELLOW='\e[1;33m' | |
CYAN='\e[1;36m' | |
PURPLE='\e[1;35m' | |
NC='\e[0m' # No Colora |
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
from xmlrpc.server import SimpleXMLRPCServer | |
from typing import Tuple | |
class RPCServer(SimpleXMLRPCServer): | |
def __init__(self, addr: Tuple[str, int], **kwargs): | |
super().__init__(addr, **kwargs) | |
self.quit = False | |
def serve_forever(self): | |
self.quit = False |
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
def plot_grad_flow(named_parameters): | |
'''Plots the gradients flowing through different layers in the net during training. | |
Can be used for checking for possible gradient vanishing / exploding problems. | |
Usage: Plug this function in Trainer class after loss.backwards() as | |
"plot_grad_flow(self.model.named_parameters())" to visualize the gradient flow''' | |
ave_grads = [] | |
max_grads= [] | |
layers = [] |
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 numpy as np | |
import matplotlib.pyplot as plt | |
import time | |
import multiprocessing as mp | |
from queue import Empty | |
class PlotterProcess(mp.Process): | |
def __init__(self, queue, series_labels, shutdown_event, output_filename): | |
super(PlotterProcess, self).__init__() |
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 argparse | |
import multiprocessing | |
import os | |
import time | |
import random | |
import tables | |
import numpy as np | |
import pandas as pd | |
from tqdm import tqdm |
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
std::string indent(int level) | |
{ | |
std::string s; | |
for (int i = 0; i<level; i++) s += " "; | |
return s; | |
} | |
void printTree(boost::property_tree::ptree &pt, int level) | |
{ | |
if (pt.empty()) |
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
{"class_name": "Model", "keras_version": "2.0.6", "config": {"layers": [{"class_name": "InputLayer", "inbound_nodes": [], "config": {"dtype": "float32", "batch_input_shape": [null, 5, 3], "name": "input_1", "sparse": false}, "name": "input_1"}, {"class_name": "LSTM", "inbound_nodes": [[["input_1", 0, 0, {}]]], "config": {"recurrent_activation": "tanh", "trainable": true, "recurrent_initializer": {"class_name": "Orthogonal", "config": {"seed": null, "gain": 1.0}}, "use_bias": true, "bias_regularizer": null, "return_state": false, "unroll": false, "bias_initializer": {"class_name": "Zeros", "config": {}}, "units": 10, "unit_forget_bias": true, "dropout": 0.0, "recurrent_dropout": 0.0, "kernel_initializer": {"class_name": "VarianceScaling", "config": {"distribution": "uniform", "scale": 1.0, "seed": null, "mode": "fan_avg"}}, "kernel_constraint": null, "activation": "tanh", "stateful": false, "activity_regularizer": null, "recurrent_regularizer": null, "name": "lstm_1", "bias_constraint": null, "go_backwards": f |
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
cmake_minimum_required(VERSION 2.8.11) | |
project(restfs_client) | |
set(CMAKE_INCLUDE_CURRENT_DIR ON) | |
include_directories( | |
include | |
usr/include/Poco/Net | |
) |
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
#include <cstdio> | |
#include <iostream> | |
#include <memory> | |
#include <stdexcept> | |
#include <string> | |
std::string exec(const char* cmd) { | |
char buffer[128]; | |
std::string result = ""; | |
std::shared_ptr<FILE> pipe(popen(cmd, "r"), pclose); |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" | |
Author: Benjamin Alt (benjamin_alt@outlook.com) | |
Calculate the character-level edit distance between a reference string and one or multiple hypotheses. | |
""" | |
from __future__ import print_function |