Skip to content

Instantly share code, notes, and snippets.

@hadifar
hadifar / tensorboard
Created November 23, 2017 07:31
visualize word2vec
tensorboard --logdir=/tmp/
@hadifar
hadifar / abstract.java
Created November 23, 2017 08:02
abstract and interface
class Example1{
public void display1(){
System.out.println("display1 method");
}
}
@hadifar
hadifar / interface.java
Created November 23, 2017 08:06
interface vs abstract
//first interface
interface Example1{
public void display1();
}
//second interface
interface Example2 {
public void display2();
}
//This interface is extending both the above interfaces
interface Example3 extends Example1,Example2{
@hadifar
hadifar / interface.java
Created November 23, 2017 08:08
interface vs abstract
interface Example1{
public void display1();
}
interface Example2 extends Example1{
}
class Example3 implements Example2{
public void display1(){
System.out.println("display1 method");
}
}
@hadifar
hadifar / keras.py
Created November 23, 2017 20:05
Embedding example
Embedding(input_dim, output_dim, weights=[embedding_matrix], input_length=max_sequence_length, trainable=False)
# -*- coding: utf-8 -*-
from gensim.models import KeyedVectors
from gensim.models import Word2Vec
from gensim.models.word2vec import LineSentence
import logging
logging.basicConfig(level=logging.INFO)
OUTPUT_FILE_PATH = './'
git clone https://github.com/PAIR-code/facets
cd facets
python3 -m pip install --upgrade pip
python3 -m pip install jupyter
jupyter notebook
jupyter nbextension install facets-dist/
sudo pip install tensorflow