Skip to content

Instantly share code, notes, and snippets.

💭
architecting

Dillon Erb dte

💭
architecting
Block or report user

Report or block dte

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Adversarial2.py
torch.manual_seed(10)
Q, P = Q_net() = Q_net(), P_net(0) # Encoder/Decoder
D_gauss = D_net_gauss() # Discriminator adversarial
if torch.cuda.is_available():
Q = Q.cuda()
P = P.cuda()
D_cat = D_gauss.cuda()
D_gauss = D_net_gauss().cuda()
# Set learning rates
gen_lr, reg_lr = 0.0006, 0.0008
View serve.py
import os
from flask import Flask, redirect, url_for, request, render_template, send_from_directory
from werkzeug import secure_filename
import not_hotdog_model
# todo: more pretty interface
# folder to upload pictures
UPLOAD_FOLDER = 'uploads/'
# what files can upload
@dte
dte / loopy_cosine_similarities.py
Created May 9, 2018
Vectorization and Broadcasting with Pytorch
View loopy_cosine_similarities.py
import torch
from torch.nn.functional import cosine_similarity
def embeddings_to_cosine_similarity_matrix(E):
"""
Converts a a tensor of n embeddings to an (n, n) tensor of similarities.
"""
similarities = [[cosine_similarity(a, b, dim=0) for a in E] for b in E]
similarities = list(map(torch.cat, similarities))
return torch.stack(similarities)
View releaseTest.md

Release Notes

New Thing 2

7/16/2018

About this

New Thing 2

7/14/2018

About this

View keybase.md

Keybase proof

I hereby claim:

  • I am dte on github.
  • I am dte (https://keybase.io/dte) on keybase.
  • I have a public key ASBUHk4r10yK56bUqf0cZ9iYkVdIqehPtxMHsTcvtYp4awo

To claim this, I am signing this object:

You can’t perform that action at this time.