This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
# numpyをnpとしてインポート | |
import numpy as np | |
# pandasをpdとしてインポート | |
import pandas as pd | |
# リストの作成 | |
d_list1 = ['Yamada Taro', 'Yamada Hanako'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import os | |
import pandas as pd | |
import numpy as np | |
#------------------- | |
# クラスの定義始まり | |
class sentence: | |
dataPath = 'sentiment_labelled_sentences' # データのフォルダ名 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import gym | |
import numpy as np | |
import pickle | |
import glob | |
import os | |
import pdb | |
class mountainCar: |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from mcpi.minecraft import Minecraft | |
from mcpi.block import * | |
import numpy as np | |
mc = Minecraft.create() | |
pos = mc.player.getTilePos() | |
r = 20 | |
numBlocks = 150 | |
for theta in np.arange(0,2*np.pi,2*np.pi/ numBlocks): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
# 数値計算用のライブラリnumpyをnpとしてインポート | |
import numpy as np | |
# 3x3のnumpy配列(行列) | |
W = np.array([ [1,0,0], [0,1/2,0], [0,0,1/3] ]) | |
H = np.array([ [1,0,0], [0,2,0], [0,0,3] ]) | |
print(f"W:\n{W}\nH:\n{H}\n") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################# | |
# tensorflow2のCNNの実装例3(もっとも玄人ぽい) | |
# Subclassing APIを用いる場合 | |
############################# | |
import tensorflow as tf | |
import pdb | |
#---------------------------- | |
# データの作成 | |
# 画像サイズ(高さ,幅,チャネル数) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################# | |
# tensorflow2のCNNの実装例3(もっとも玄人ぽい) | |
# Subclassing APIを用いる場合 | |
############################# | |
import tensorflow as tf | |
import pdb | |
#---------------------------- | |
# データの作成 | |
# 画像サイズ(高さ,幅,チャネル数) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################# | |
# tensorflow2のCNNの実装例1(もっとも素人ぽい) | |
# Sequential APIを用いる場合 | |
############################# | |
import tensorflow as tf | |
#---------------------------- | |
# データの作成 | |
# 画像サイズ(高さ,幅,チャネル数) | |
H, W, C = 28, 28, 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################# | |
# tensorflow2のCNNの実装例2(tensorflow 1系ぽい) | |
# Functional APIを用いる場合 | |
############################# | |
import tensorflow as tf | |
#---------------------------- | |
# データの作成 | |
# 画像サイズ(高さ,幅,チャネル数) | |
H, W, C = 28, 28, 1 |
OlderNewer