Skip to content

Instantly share code, notes, and snippets.

View ayemos's full-sized avatar
🔪
{neutral}

Yuichiro Someya ayemos

🔪
{neutral}
View GitHub Profile
View 📊 Weekly development breakdown
Ruby 51 mins ████▌░░░░░░░░░░░░░░░░ 21.7%
YAML 49 mins ████▍░░░░░░░░░░░░░░░░ 20.9%
JSON 43 mins ███▊░░░░░░░░░░░░░░░░░ 18.2%
Markdown 21 mins █▉░░░░░░░░░░░░░░░░░░░ 9.0%
Haml 16 mins █▍░░░░░░░░░░░░░░░░░░░ 6.8%
View gist:d4620a5b128145ffce1fd554d206bd3c
┌──────────────┐
│ │
│ Home network │
│ │
└──────────────┘
┌──────────────┐ ┌────────────────────┐
│ NETGEAR │ │ Macbook Pro │
│ GS105-500JPS │────────────────────────────────────│ (Roon Core, Tidal) │◀─────┐
View wrangler_004.py
from datetime import datetime, timedelta
import random
import awswrangler
import pandas as pd
df = pd.DataFrame(
{
'x': (random.random() for _ in range(1000)),
'date': (
View wrangler_003.py
import awswrangler
session = awswrangler.Session()
df_athena = session.pandas.read_sql_athena(
'select * from dummy_table',
database='wrangler_db')
print(df_athena)
View wrangler_002.py
import random
import awswrangler
import pandas as pd
df = pd.DataFrame(
{
'x': (random.random() for _ in range(1000)),
'y': (random.random() for _ in range(1000))})
View wrangler_001.py
import random
import awswrangler
import pandas as pd
df = pd.DataFrame(
{
'x': (random.random() for _ in range(1000)),
'y': (random.random() for _ in range(1000))})
View gist:226d4e4def0cb61086d4b94ca2377ea6
mkdir ignore_tmp;cd ignore_tmp;mkdir -p data/deep{,_dont_check_in};touch data/deep{,_dont_check_in}/foo;touch data/deep/.gitkeep;echo '/data/**\n!/data/deep/\n!/data/deep_dont_check_in/\n!/data/*/.gitkeep' > .gitignore
View chainer_composite.md

コラム - chainer.Linkクラスとchainer.ChainクラスによるCompositeパターン

ニューラルネットワークの中には、〜またはさらにその集まりで構成されるような大変複雑な物があります。(例: Google のInception-v4モデル https://research.google.com/pubs/pub45169.html) Chainerでは、GoFのデザインパターンの一つであるCompositeパターンを利用して、このような複雑なニューラルネットワークも柔軟に表現できるようになっています。

chainer.Linkは「入力に対して出力を出す」という共通のインターフェースを提供しており、そのサブクラスであるchainer.Chainも同様です。例えば、Linkオブジェクト l1, l2 と Chainオブジェクト c1 があった時に、 

l1(l2(c1)

のように出力を次のオブジェクトの入力として数珠つなぎにしていくことが出来ます。