--- /dev/null
+from setuptools import setup
+
+setup(
+ name='ultreron',
+ version='0.0.1',
+ packages=[''],
+ package_dir={'': 'src/main/Python'},
+ url='',
+ license='',
+ author='Saitoh Yosihiro',
+ author_email='shupeluter@hotmail.com',
+ description=''
+)
from keras.models import Model
from keras.models import model_from_yaml
from keras.layers import Dense, Input, Dropout
-import yaml
-import os.path
+
+
+class ModelGenerator:
+ """
+ 学習モデルを生成するクラス。主に以下の処理を実施する。
+ 1. 指定ディレクトリ配下に配置されてる学習データから、テストデータ、訓練データを作成する。
+ 2. 訓練データを用いてモデルの重みを生成
+ 3. モデルの定義および重みづけデータを外部ファイルに出力
+ 4. 外部ファイルに定義されたモデルデータをよび重みづけデータをもとに学習モデルを再現
+
+ """
+
def generate_data():
def regenerate_leaning_model(model_path='data.yml', param_path='param.hdf5'):
-
with open(model_path) as model_yaml_file:
model_yaml = model_yaml_file.read()
--- /dev/null
+from keras.models import Model
+from Learning import ModelGenerator
+import Learning
+import numpy
+
+
+def predict(target: str):
+ """
+ 与えられたパターン(50 x 10)を使い、連続期間を判定する。
+ :param target:
+ :return:
+ """
+ # データ分割
+ target = target.split(",")
+
+ # データサイズ確認
+ if(500 != len(target)):
+ # 例外をスロー
+ print("Unsuported Process. yet")
+
+ # データ変換
+ target = numpy.array(target, dtype=numpy.float32)
+ target = target.reshape(1, 500).astype(float)
+ model = Learning.regenerate_leaning_model() #type: Model
+ result = model.predict(target,batch_size=1).astype(float)
+
+ # 結果をログ出力(debug)
+ numpy.set_printoptions(precision=3, suppress=True)
+ return result
+
+
--- /dev/null
+backend: tensorflow
+class_name: Model
+config:
+ input_layers:
+ - [input_1, 0, 0]
+ layers:
+ - class_name: InputLayer
+ config:
+ batch_input_shape: !!python/tuple [null, 500]
+ dtype: float32
+ name: input_1
+ sparse: false
+ inbound_nodes: []
+ name: input_1
+ - class_name: Dense
+ config:
+ activation: relu
+ activity_regularizer: null
+ bias_constraint: null
+ bias_initializer:
+ class_name: Zeros
+ config: {}
+ bias_regularizer: null
+ kernel_constraint: null
+ kernel_initializer:
+ class_name: VarianceScaling
+ config: {distribution: uniform, mode: fan_avg, scale: 1.0, seed: null}
+ kernel_regularizer: null
+ name: dense_1
+ trainable: true
+ units: 200
+ use_bias: true
+ inbound_nodes:
+ - - - input_1
+ - 0
+ - 0
+ - {}
+ name: dense_1
+ - class_name: Dropout
+ config: {name: dropout_1, noise_shape: null, rate: 0.5, seed: null, trainable: true}
+ inbound_nodes:
+ - - - dense_1
+ - 0
+ - 0
+ - {}
+ name: dropout_1
+ - class_name: Dense
+ config:
+ activation: relu
+ activity_regularizer: null
+ bias_constraint: null
+ bias_initializer:
+ class_name: Zeros
+ config: {}
+ bias_regularizer: null
+ kernel_constraint: null
+ kernel_initializer:
+ class_name: VarianceScaling
+ config: {distribution: uniform, mode: fan_avg, scale: 1.0, seed: null}
+ kernel_regularizer: null
+ name: dense_2
+ trainable: true
+ units: 100
+ use_bias: true
+ inbound_nodes:
+ - - - dropout_1
+ - 0
+ - 0
+ - {}
+ name: dense_2
+ - class_name: Dropout
+ config: {name: dropout_2, noise_shape: null, rate: 0.5, seed: null, trainable: true}
+ inbound_nodes:
+ - - - dense_2
+ - 0
+ - 0
+ - {}
+ name: dropout_2
+ - class_name: Dense
+ config:
+ activation: softmax
+ activity_regularizer: null
+ bias_constraint: null
+ bias_initializer:
+ class_name: Zeros
+ config: {}
+ bias_regularizer: null
+ kernel_constraint: null
+ kernel_initializer:
+ class_name: VarianceScaling
+ config: {distribution: uniform, mode: fan_avg, scale: 1.0, seed: null}
+ kernel_regularizer: null
+ name: dense_3
+ trainable: true
+ units: 11
+ use_bias: true
+ inbound_nodes:
+ - - - dropout_2
+ - 0
+ - 0
+ - {}
+ name: dense_3
+ name: model_1
+ output_layers:
+ - [dense_3, 0, 0]
+keras_version: 2.1.6
from keras.datasets import mnist
from keras.layers import Dense,Input,Dropout
-from keras.models import Model
import keras
--- /dev/null
+Metadata-Version: 1.0
+Name: ultreron
+Version: 0.0.1
+Summary: UNKNOWN
+Home-page: UNKNOWN
+Author: Saitoh Yosihiro
+Author-email: shupeluter@hotmail.com
+License: UNKNOWN
+Description: UNKNOWN
+Platform: UNKNOWN
--- /dev/null
+setup.py
+src/main/Python/ultreron.egg-info/PKG-INFO
+src/main/Python/ultreron.egg-info/SOURCES.txt
+src/main/Python/ultreron.egg-info/dependency_links.txt
+src/main/Python/ultreron.egg-info/top_level.txt
+src/main/Python/Data.py
+src/main/Python/DataReader.py
+src/main/Python/DatasetGenerator.py
+src/main/Python/Exceptions.py
+src/main/Python/Learning.py
+src/main/Python/Predictor.py
+src/main/Python/foo.py
+src/main/Python/ultreron.egg-info/PKG-INFO
+src/main/Python/ultreron.egg-info/SOURCES.txt
+src/main/Python/ultreron.egg-info/dependency_links.txt
+src/main/Python/ultreron.egg-info/top_level.txt
\ No newline at end of file
--- /dev/null
+swagger: "2.0"
+info:
+ description: "連続データ幅を返却する"
+ title: "連続データ取得"
+ version: "1.0.0"
+paths:
+ /sequencewidth:
+ get:
+ summary: "連続幅取得API"
+ parameters:
+ - name: target_name
+ in: query
+ description: 判定したいデータ 現状サイズ固定(サイズはおって記載)
+ type: string
+ - name: data_model
+ in: query
+ description: 利用するデータモデルを確定させる。現状Not service yet.
+ type: string
+
+ responses:
+ 200:
+ description: "データ取得成功"
+ schema:
+ type: "object"
+ properties:
+ fulldata:
+ type: "array"
+ items:
+ type: number
+ result:
+ type: number
+