Skip to content

Instantly share code, notes, and snippets.

View khirotaka's full-sized avatar
🦉
Under studying at 🏡

Hirotaka Kawashima khirotaka

🦉
Under studying at 🏡
View GitHub Profile
@khirotaka
khirotaka / main.swift
Created March 6, 2019 11:09
Swift for TensorFlow MNIST
import Foundation
import TensorFlow
import Python
PythonLibrary.useVersion(3, 6)
let np = Python.import("numpy")
let (x_train, y_train) = readMNIST(imagesFile: "Resources/train-images.idx3-ubyte",
labelsFile: "Resources/train-labels.idx1-ubyte")

KDD 19 Survey Partly

1, Deep Landscape Forecasting for Real-time Bidding Advertising

GitHub

Paper

Abstract

The emergence of real-time auction in online advertising has drawn huge attention of modeling the market competition, i.e., bid landscape forecasting. The problem is formulated as to forecast the probability distribution of market price for each ad auction. With the consideration of the censorship issue which is caused by the second-price auction mechanism, many researchers have devoted their efforts on bid landscape forecasting by incorporating survival analysis from medical research field. However, most existing solutions mainly focus on either counting-based statistics of the segmented sample clusters, or learning a parameterized model based on some heuristic assumptions of distribution forms. Moreover, they neither consider the sequential patterns of the feature over the price space. In order to capture more sophisticat

import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
from torch.utils.data import TensorDataset, DataLoader
import matplotlib.pyplot as plt
X = torch.tensor([
[i] for i in np.arange(1, 4.1, 0.1)
import time
import torch
import torch.nn as nn
import torch.optim as optim
from torch.utils.data import DataLoader
from torchvision import datasets, transforms
torch.backends.cudnn.benchmark = True
from collections import Counter
import numpy as np
class SlidingWindow:
def __init__(self, window_size, overlap_rate=0.5):
self.window_size = window_size
assert 0.0 < overlap_rate and overlap_rate <= 1.0
self.overlap_rate = overlap_rate
self.overlap = int(window_size * overlap_rate)
@khirotaka
khirotaka / fizzbuzz.sh
Last active January 4, 2020 12:10
Bash で FizzBuzzをするコード。Bashの練習のため
#!/bin/zsh
function fizzbuzz () {
if [ $(( $1 % 15 )) -eq 0 ]; then
echo FizzBuzz
elif [ $(( $1 % 3 )) -eq 0 ]; then
echo Fizz
elif [ $(( $1 % 5 )) -eq 0 ]; then
echo Buzz
else
@khirotaka
khirotaka / __init__.pyi
Last active December 30, 2019 10:41
fixed nn.MultiheadAttention on PyTorch v.1.2.0 Input Completion for PyCharm.
from ... import Tensor
from .. import Parameter
from .module import Mudule
from typinh import Any, Optional
"""
add this code to
https://github.com/pytorch/pytorch/blob/ff7921e85bad0ad47bc7fa6d48c2f8762cf3f6b3/torch/nn/modules/__init__.pyi.in#L2-L6
@khirotaka
khirotaka / trainer.py
Last active September 13, 2019 12:52
Comet.ml with PyTorch
import os
import time
import tqdm
import torch
import torch.nn as nn
from torch.utils.data import DataLoader
class NeuralNetworkClassifier:
def __init__(self, model, criterion, optimizer, optimizer_config: dict, experiment) -> None:

AAAI 2019


Adversarial Unsupervised Representation Learning for Activity Time-Series

Abstract

Sufficient physical activity and restful sleep play a major role in the prevention and cure of many chronic conditions. Being able to proactively screen and monitor such chronic conditions would be a big step forward for overall health.

@khirotaka
khirotaka / IJCAI-18_TimeSeries.md
Last active December 14, 2021 09:09
[memo] IJCAI-19 Time Series

IJCAI 2018


GeoMAN: Multi-level Attention Networks for Geo-sensory Time Series Prediction

Abstract

Numerous sensors have been deployed in different geospatial locations to continuously and cooperatively monitor the surrounding environment, such as the air quality. These sensors generate multiple geo-sensory time series, with spatial correlations between their readings. Forecasting geo-sensory time series is of great importance yet very challenging as it is affected by many complex factors, i.e., dynamic spatio-temporal correlations and external factors. In this paper, we predict the readings of a geo-sensor over several future hours by using a multi-level attention-based recurrent neural network that considers multiple sensors' readings, meteorological data, and spatial data. More specifically, our model consists of two major parts: 1) a multi-level attention mechanism to model the dynamic spatio-te