Skip to content

Instantly share code, notes, and snippets.

import numpy as np
from sklearn.metrics import roc_auc_score
n_class_0 = 50000
n_class_1 = 100
def main():
# Suppose imblanced classification dataset
labels = n_class_0 * [False] + n_class_1 * [True]
y_true = n_class_0 * [0] + n_class_1 * [1]
import ogr
import osr
high_ref = osr.SpatialReference()
low_ref = osr.SpatialReference()
coord_topleft = pixel2coord(high_res_raster, (col_high_res, row_high_res))
high_ref.ImportFromWkt(high_res_raster.GetProjection())
low_ref.ImportFromWkt(low_res_raster.GetProjection())
@mikigom
mikigom / tf_bilinear_additive_upsampling.py
Created July 24, 2017 10:41
Tensorflow Implementation of Bilinear Additive Upsampling
import tensorflow as tf
"""
Author : @MikiBear_
Tensorflow Implementation of Bilinear Additive Upsampling.
Reference : https://arxiv.org/abs/1707.05847
"""
def bilinear_additive_upsampling(x, to_channel_num, name):
from_channel_num = x.get_shape().as_list()[3]
assert from_channel_num % to_channel_num == 0

Task 1) Pintos Thread System

1. How the switching between threads occur?

schedule() is responsible for switching threads in threads/thread.c.

static void
schedule (void) 
{
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
struct nameTag{
char fname[20]; char lname[20];
};
struct nameTag * wrong_getname(void){
struct nameTag newname;
import tensorflow as tf
slim = tf.contrib.slim
class Unet(object):
def __init__(self, input, class_num, reuse = False):
self.input = input
self.reuse = reuse
self.class_num = class_num
self.build_model()
module multiplexer(Y, A, B, C, D);
output Y;
input A, B, C, D;
assign Y = (A&B)|(C&D);
endmodule
module D_ff(Q, CLK, D);
output Q;
input CLK, D;
import subprocess
import unittest
import sys
import filecmp
bash_call = './' + sys.argv[1]
def subprocess_pipe(cmd_list):
prev_stdin = None
last_p = None
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <unistd.h>
#include <wait.h>
#define CHUNK 1
char** res = NULL;
@mikigom
mikigom / linear_regression_code.ipynb
Last active April 26, 2017 09:50
Project Nagne DL semina code
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.