プライム・ラディエント

あなたは、心理歴史学者たちが、Google ColabとTensorBoardを使って議論していると思いますか?

全ては11,988年GE(銀河歴)に、ハリ・セルダンが惑星ヘリコンに生まれた時に始まったのです。

Google Colab (無し, GPU, TPU)

あなたは、2種類のハードウェア・アクセラレータの中から選択することができます。

アクセラレータ無しでは、このようになります:

しかし、GPUを用いると:

GPUを用いることにより、6倍ほど早くなっています。


Googleが提供するサンプル・プログラムでは、GPUを用いることで20倍の高速化が達成されています。

また、別のサンプル・プログラムでは、TPUを用いると162.58 TFlopsの性能を見ることができます。

Google Colab

Colaboratory is a free Jupyter notebook environment that requires no setup and runs entirely in the cloud.

あなたは、あなたのJupyter notebookをアップロードして、クラウドで走らせることが出来ます。

QLF? (2)

この方が、それらしいですか?

時間軸上でシフトを加えると、うまくいきません。

import matplotlib.pyplot as plt
import numpy as np
from sklearn.manifold import TSNE

alphabet = list("abcdefghijklmnopqrstuvwxyz")

values = ['111000111111111000', '111111111000111000111000111000', '111111111000111000111111111000111000', '111111111000111000111000', '111000',
          '111000111000111111111000111000', '111111111000111111111000111000', '111000111000111000111000', '111000111000', '111000111111111000111111111000111111111000',
          '111111111000111000111111111000', '111000111111111000111000111000', '111111111000111111111000', '111111111000111000', '111111111000111111111000111111111000',
          '111000111111111000111111111000111000', '111111111000111111111000111000111111111000', '111000111111111000111000', '111000111000111000', '111111111000',
          '111000111000111111111000', '111000111000111000111111111000', '111000111111111000111111111000', '111111111000111000111000111111111000', '111111111000111000111111111000111111111000',
          '111111111000111111111000111000111000']


morse_dict = dict(zip(alphabet, values))

nrepeat = 100
n = len(values)
word_len = 50

code_len_max = 0
for v in values:
    code_len_max = max(code_len_max, len(v))
print("code_len_max = ", code_len_max)

X = np.zeros((n * nrepeat, word_len))
Y = np.zeros(n * nrepeat, dtype=np.int)

for rep in range(nrepeat):
    for i, letter in enumerate(alphabet):
        joffset = int(np.random.uniform(1, word_len - code_len_max))
        for j in range(word_len):
            X[i + rep * n][j] = np.random.normal(0.0, 0.2)
        for j, char in enumerate(morse_dict[letter]):
            X[i+rep * n][j+joffset] = X[i+rep * n][j+joffset] + (ord(char) - ord('0'))
        Y[i+rep * n] = i

X_reduced = TSNE(n_components=2, random_state=0, perplexity=50).fit_transform(X)

plt.figure(figsize=(8, 12))

plt.subplot(3, 1, 1)
x = np.arange(word_len)
for i in range(3):
    y = X[i, :] + 2.0 * i
    plt.plot(x, y)
plt.grid()
plt.title('Waveform')

plt.subplot(3, 1, 2)
plt.scatter(X_reduced[:, 0], X_reduced[:, 1],
            c=Y, edgecolors='black', alpha=0.5)
plt.colorbar()
plt.title('t-SNE')

plt.subplot(3, 1, 3)
for rep in range(min(3, nrepeat)):
    for i, letter in enumerate(alphabet):
        s = chr(Y[i] + ord('a'))
        plt.text(X_reduced[i+rep*n, 0], X_reduced[i+rep*n, 1], s)
plt.xlim([min(X_reduced[:, 0]), max(X_reduced[:, 0])])
plt.ylim([min(X_reduced[:, 1]), max(X_reduced[:, 1])])
plt.title('t-SNE')

plt.show()