Skip to content

Instantly share code, notes, and snippets.

View halhorn's full-sized avatar

Harumitsu Nobuta halhorn

View GitHub Profile
@halhorn
halhorn / ScenarioEditorModules.markdown
Last active February 28, 2022 07:27
シナリオエディターモジュール集

モジュール一覧

abs

絶対値を返します。 例えば-1を入力すると1が返ります。

### 引数
  • val: 入力する数値
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@halhorn
halhorn / mnist.py
Created September 21, 2017 09:41
test for GPU using
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets('MNIST_data', one_hot=True)
import tensorflow as tf
sess = tf.InteractiveSession()
x = tf.placeholder(tf.float32, shape=[None, 784])
y_ = tf.placeholder(tf.float32, shape=[None, 10])
W = tf.Variable(tf.zeros([784,10]))

課題3

改行区切りの email アドレスのリストが標準入力経由で渡されます。 この email アドレスがページ末にある仕様として正当なものであれば ok を、そうでなければ ng を改行区切りのリストとして標準出力へ書き込むプログラム validate_addr_spec を実装してください。

なお、既存のメールアドレス判定関数は使わずに、自前で書いてください!

入力の例

課題2-1

数値を受け取り、その円の面積を四捨五入して整数に丸め返す関数 calc_area を実装してください。 なお、与えられる数値は10進表記の正またはゼロの実数で、大きさは 10000 未満です。

result = calc_area(10)
# result: 314
@halhorn
halhorn / deepdream.py
Created July 21, 2015 12:14
DeepDreamのコード
# imports and basic notebook setup
from cStringIO import StringIO
import numpy as np
import scipy.ndimage as nd
import PIL.Image
from IPython.display import clear_output, Image, display
from google.protobuf import text_format
import caffe
brew update
brew upgrade