Skip to content

Instantly share code, notes, and snippets.

View memakura's full-sized avatar

Hiroaki Kawashima memakura

  • Kyoto, Japan
View GitHub Profile
@memakura
memakura / tied_linear.py
Created July 3, 2021 07:27 — forked from InnovArul/tied_linear.py
tied linear layer experiment
import torch, torch.nn as nn, torch.nn.functional as F
import numpy as np
import torch.optim as optim
# tied autoencoder using off the shelf nn modules
class TiedAutoEncoderOffTheShelf(nn.Module):
def __init__(self, inp, out, weight):
super().__init__()
self.encoder = nn.Linear(inp, out, bias=False)
self.decoder = nn.Linear(out, inp, bias=False)
@memakura
memakura / fullscreenshot.py
Last active October 14, 2018 03:42
Full-page screenshot for Selenium
# -*- coding: utf-8 -*-
# Original:
# https://gist.github.com/yui3880/a63ced61806d8517c4a3
# https://qiita.com/myhr/items/dff7cee30182ab56f737
#
# Changelog:
# - Use in-memory process
# - Remove fullsize flag
# - Replace self to driver
# - Add scrollbar removal