Skip to content

Instantly share code, notes, and snippets.

View isspek's full-sized avatar
😄

isspek isspek

😄
  • UPV, @DW-ReCo
  • Koblenz, Germany
  • X @ipekbrs
View GitHub Profile
@isspek
isspek / than.py
Last active January 26, 2021 09:00
import os
os.environ['KERAS_BACKEND'] = 'theano'
from keras.layers import Dense, Input
from keras.layers import Embedding, Dropout, GRU, Bidirectional, TimeDistributed, concatenate, Masking
from keras.models import Model
from keras.layers.core import Reshape
from keras import backend as K
from keras.engine.topology import Layer
@isspek
isspek / gist:0fbeda0de8c0cc6b1448e2f216ff862f
Last active January 3, 2021 21:59
Can not get_weights() in custom train step
def train_step(self, input_data):
labeled_data, labels = input_data
# Train the both
with tf.GradientTape() as tape:
augmented_data, augmented_labels = augment_data(labeled_data, labels, self.unlabeled_train)
logits_student = self.student(augmented_data)
clf_loss = self.classification_costs(logits_student, augmented_labels)
# we augment the data again
<!DOCTYPE html>
<!--[if lt IE 7]><html lang="tr" xmlns:fb="https://www.facebook.com/2008/fbml" xmlns:addthis="https://www.addthis.com/help/api-spec" class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if (IE 7)&!(IEMobile)]><html lang="tr" xmlns:fb="https://www.facebook.com/2008/fbml" xmlns:addthis="https://www.addthis.com/help/api-spec" class="no-js lt-ie9 lt-ie8"><![endif]-->
<!--[if (IE 8)&!(IEMobile)]><html lang="tr" xmlns:fb="https://www.facebook.com/2008/fbml" xmlns:addthis="https://www.addthis.com/help/api-spec" class="no-js lt-ie9"><![endif]-->
<!--[if gt IE 8]><!--> <html lang="tr" xmlns:fb="https://www.facebook.com/2008/fbml" xmlns:addthis="https://www.addthis.com/help/api-spec" class="no-js"><!--<![endif]-->
<head>
<meta charset="utf-8">
<!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge" /><![endif]-->
import numpy as np
def split_dataset(x, y,save = False, path = 'dataset'):
num_samples = len(x)
indices = np.arange(num_samples)
np.random.shuffle(indices)
split_1 = int(0.8 * num_samples)
split_2 = int(0.9 * num_samples)
indices_train = indices[1:split_1]
indices_dev = indices[split_1:split_2]
indices_test = indices[split_2:]
@isspek
isspek / cuda_9.0_cudnn_7.0.sh
Created October 10, 2018 20:52 — forked from ashokpant/cuda_9.0_cudnn_7.0.sh
Install CUDA Toolkit v9.0 and cuDNN v7.0 on Ubuntu 16.04
#!/bin/bash
# install CUDA Toolkit v9.0
# instructions from https://developer.nvidia.com/cuda-downloads (linux -> x86_64 -> Ubuntu -> 16.04 -> deb)
CUDA_REPO_PKG="cuda-repo-ubuntu1604-9-0-local_9.0.176-1_amd64-deb"
wget https://developer.nvidia.com/compute/cuda/9.0/Prod/local_installers/${CUDA_REPO_PKG}
sudo dpkg -i ${CUDA_REPO_PKG}
sudo apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/7fa2af80.pub
sudo apt-get update
sudo apt-get -y install cuda-9-0
@isspek
isspek / Install NVIDIA Driver and CUDA.md
Created September 25, 2018 14:41 — forked from wangruohui/Install NVIDIA Driver and CUDA.md
Install NVIDIA Driver and CUDA on Ubuntu / CentOS / Fedora Linux OS
@isspek
isspek / gist:ce2efa3fc8282a4286f8e93f45cd1a9a
Created July 3, 2017 18:42
False Positive, True Positive, False Negative
False positive: Doğru varsayılan örneğin yanlış çıkması
False negative: Yanlış varsayılan örneğin aslında doğru olması
True positive: Örneğin doğru tahmin edilmesi
@isspek
isspek / HttpManagement.java
Last active June 9, 2017 14:33
Modification of HttpManagement in GERBIL for proxy servers
/**
* This file is part of General Entity Annotator Benchmark.
*
* General Entity Annotator Benchmark is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* General Entity Annotator Benchmark is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of