Commit 8513714f authored by ymir's avatar ymir

use extra help as TNR

parent 2f09aeb8
Here are some examples for each possible resource and actions
***** PERCEPTRON *****
#Here are some examples for each possible resource and actions
set -xe
#***** PERCEPTRON *****
PERCEPTRON_ARCHIVE=/tmp/perceptron.gz
-> randomize
#-> randomize
rm ${PERCEPTRON_ARCHIVE}
python3 neuralnetworktrainercli.py randomize perceptron -d 10 2 -c "randomized perceptron" -a ${PERCEPTRON_ARCHIVE}
ls -lh ${PERCEPTRON_ARCHIVE}
-> create
#-> create
PERCEPTRON_ID=`python3 neuralnetworktrainercli.py create perceptron -a ${PERCEPTRON_ARCHIVE}`
echo ${PERCEPTRON_ID}
-> read single
#-> read single
rm ${PERCEPTRON_ARCHIVE}
python3 neuralnetworktrainercli.py read perceptron -i ${PERCEPTRON_ID} -a ${PERCEPTRON_ARCHIVE}
ls -lh ${PERCEPTRON_ARCHIVE}
-> update
#-> update
python3 neuralnetworktrainercli.py update perceptron -i ${PERCEPTRON_ID} -a ${PERCEPTRON_ARCHIVE}
-> patch
#-> patch
python3 neuralnetworktrainercli.py patch perceptron -i ${PERCEPTRON_ID} -c "patched perceptron"
-> summarize
#-> summarize
python3 neuralnetworktrainercli.py summarize perceptron -i ${PERCEPTRON_ID}
-> delete single
#-> delete single
python3 neuralnetworktrainercli.py delete perceptron -i ${PERCEPTRON_ID}
-> read all
#-> read all
for i in {0..7}
do
python3 neuralnetworktrainercli.py randomize perceptron -d 1 1 -a ${PERCEPTRON_ARCHIVE}
python3 neuralnetworktrainercli.py create perceptron -a ${PERCEPTRON_ARCHIVE}
done
python3 neuralnetworktrainercli.py read perceptron
-> delete all
#-> delete all
python3 neuralnetworktrainercli.py delete perceptron
***** TRAINING SET *****
#***** TRAINING SET *****
TRAININGSET_ARCHIVE=/tmp/trainingset.gz
rm ${TRAININGSET_ARCHIVE}
echo '{
......@@ -44,54 +45,54 @@ echo '{
],
"comments": "test training set"
}' | gzip > ${TRAININGSET_ARCHIVE}
-> create
#-> create
TRAININGSET_ID=`python3 neuralnetworktrainercli.py create trainingset -a ${TRAININGSET_ARCHIVE}`
echo ${TRAININGSET_ID}
-> read single
#-> read single
rm ${TRAININGSET_ARCHIVE}
python3 neuralnetworktrainercli.py read trainingset -i ${TRAININGSET_ID} -a ${TRAININGSET_ARCHIVE}
ls -lh ${TRAININGSET_ARCHIVE}
-> update
#-> update
python3 neuralnetworktrainercli.py update trainingset -i ${TRAININGSET_ID} -a ${TRAININGSET_ARCHIVE}
-> patch
#-> patch
python3 neuralnetworktrainercli.py patch trainingset -i ${TRAININGSET_ID} -c "patched trainingset"
-> summarize
#-> summarize
python3 neuralnetworktrainercli.py summarize trainingset -i ${TRAININGSET_ID}
-> delete single
#-> delete single
python3 neuralnetworktrainercli.py delete trainingset -i ${TRAININGSET_ID}
-> read all
#-> read all
for i in {0..7}
do
python3 neuralnetworktrainercli.py create trainingset -a ${TRAININGSET_ARCHIVE}
done
python3 neuralnetworktrainercli.py read trainingset
-> delete all
#-> delete all
python3 neuralnetworktrainercli.py delete trainingset
***** TRAINING SESSION *****
#***** TRAINING SESSION *****
PERCEPTRON_ID=`python3 neuralnetworktrainercli.py create perceptron -a ${PERCEPTRON_ARCHIVE}`
echo ${PERCEPTRON_ID}
TRAININGSET_ID=`python3 neuralnetworktrainercli.py create trainingset -a ${TRAININGSET_ARCHIVE}`
echo ${TRAININGSET_ID}
TRAININGSESSION_ARCHIVE=/tmp/trainingsession.gz
-> randomize
#-> randomize
rm ${TRAININGSESSION_ARCHIVE}
python3 neuralnetworktrainercli.py randomize trainingsession -i ${PERCEPTRON_ID} -t ${TRAININGSET_ID} -z 1 -s 4 -r 0 -c "randomized training session" -a ${TRAININGSESSION_ARCHIVE}
ls -lh ${TRAININGSESSION_ARCHIVE}
-> create
#-> create
python3 neuralnetworktrainercli.py create trainingsession -i ${PERCEPTRON_ID} -a ${TRAININGSESSION_ARCHIVE}
-> read single
#-> read single
rm ${TRAININGSESSION_ARCHIVE}
python3 neuralnetworktrainercli.py read trainingsession -i ${PERCEPTRON_ID} -a ${TRAININGSESSION_ARCHIVE}
ls -lh ${TRAININGSESSION_ARCHIVE}
-> update
#-> update
python3 neuralnetworktrainercli.py update trainingsession -i ${PERCEPTRON_ID} -a ${TRAININGSESSION_ARCHIVE}
-> patch
#-> patch
python3 neuralnetworktrainercli.py patch trainingsession -i ${PERCEPTRON_ID} -z 2 -s 5 -c "patched trainingsession"
-> summarize
#-> summarize
python3 neuralnetworktrainercli.py summarize trainingsession -i ${PERCEPTRON_ID}
-> delete single
#-> delete single
python3 neuralnetworktrainercli.py delete trainingsession -i ${PERCEPTRON_ID}
-> read all
#-> read all
for i in {0..7}
do
PERCEPTRON_ID=`python3 neuralnetworktrainercli.py create perceptron -a ${PERCEPTRON_ARCHIVE}`
......@@ -99,7 +100,7 @@ do
python3 neuralnetworktrainercli.py create trainingsession -i ${PERCEPTRON_ID} -a ${TRAININGSESSION_ARCHIVE}
done
python3 neuralnetworktrainercli.py read trainingsession
-> delete all
#-> delete all
python3 neuralnetworktrainercli.py delete trainingsession
***** TRAINER *****
-------------------------------------------------------------
\ No newline at end of file
#***** TRAINER *****
#-------------------------------------------------------------
\ No newline at end of file
......@@ -12,7 +12,7 @@ import sys
# contants
currentDirectory = realpath(__file__).rsplit(sep, 1)[0]
configurationFile=join(currentDirectory,"conf","neuralnetworktrainercli.conf")
extraHelpFile=join(currentDirectory,"help","neuralnetworktrainercli.txt")
extraHelpFile=join(currentDirectory,"help","neuralnetworktrainercli.sh")
@unique
class ContentType(Enum):
JSON = {"Content-Type": "application/json"}
......@@ -80,7 +80,7 @@ def readSinglePerceptron(id,archive):
# read all
def readAllPerceptron():
URL=baseURL+"/perceptron"
response = get(URL, headers=ContentType.JSON.value)
response = get(URL)
checkresponse(response)
print(response.text)
pass
......@@ -95,26 +95,26 @@ def updatePerceptron(id,archive):
def patchPerceptron(id,comments):
URL=baseURL+"/perceptron/"+str(id)
data=dumps({"comments":comments})
response = patch(URL, data=data, headers=ContentType.GZIP.value)
response = patch(URL, data=data)
checkresponse(response)
pass
# summarize
def summarizePerceptron(id):
URL=baseURL+"/perceptron/"+str(id)+"/summary"
response = get(URL, headers=ContentType.JSON.value)
response = get(URL)
checkresponse(response)
print(response.text)
pass
# delete
def deleteSinglePerceptron(id):
URL=baseURL+"/perceptron/"+str(id)
response = delete(URL, headers=ContentType.JSON.value)
response = delete(URL)
checkresponse(response)
pass
# delete
def deleteAllPerceptron():
URL=baseURL+"/perceptron"
response = delete(URL, headers=ContentType.JSON.value)
response = delete(URL)
checkresponse(response)
pass
# ***** TRAINING SET *****
......@@ -136,7 +136,7 @@ def readSingleTrainingSet(id,archive):
# read all
def readAllTrainingSet():
URL=baseURL+"/trainingset"
response = get(URL, headers=ContentType.JSON.value)
response = get(URL)
checkresponse(response)
print(response.text)
pass
......@@ -151,26 +151,26 @@ def updateTrainingSet(id,archive):
def patchTrainingSet(id,comments):
URL=baseURL+"/trainingset/"+str(id)
data=dumps({"comments":comments})
response = patch(URL, data=data, headers=ContentType.GZIP.value)
response = patch(URL, data=data)
checkresponse(response)
pass
# summarize
def summarizeTrainingSet(id):
URL=baseURL+"/trainingset/"+str(id)+"/summary"
response = get(URL, headers=ContentType.JSON.value)
response = get(URL)
checkresponse(response)
print(response.text)
pass
# delete
def deleteSingleTrainingSet(id):
URL=baseURL+"/trainingset/"+str(id)
response = delete(URL, headers=ContentType.JSON.value)
response = delete(URL)
checkresponse(response)
pass
# delete
def deleteAllTrainingSet():
URL=baseURL+"/trainingset"
response = delete(URL, headers=ContentType.JSON.value)
response = delete(URL)
checkresponse(response)
pass
# ***** TRAINING SESSION *****
......@@ -199,7 +199,7 @@ def readSingleTrainingsession(id,archive):
# read all
def readAllTrainingsession():
URL=baseURL+"/perceptron/trainingsession"
response = get(URL, headers=ContentType.JSON.value)
response = get(URL)
checkresponse(response)
print(response.text)
pass
......@@ -214,26 +214,26 @@ def updateTrainingsession(id,archive):
def patchTrainingsession(id,trainingChunkSize,saveInterval,comments):
URL=baseURL+"/perceptron/"+str(id)+"/trainingsession"
data=dumps({"trainingChunkSize":trainingChunkSize,"saveInterval":saveInterval,"comments":comments})
response = patch(URL, data=data, headers=ContentType.JSON.value)
response = patch(URL, data=data)
checkresponse(response)
pass
# summarize
def summarizeTrainingsession(id):
URL=baseURL+"/perceptron/"+str(id)+"/trainingsession/summary"
response = get(URL, headers=ContentType.JSON.value)
response = get(URL)
checkresponse(response)
print(response.text)
pass
# delete
def deleteSingleTrainingsession(id):
URL=baseURL+"/perceptron/"+str(id)+"/trainingsession"
response = delete(URL, headers=ContentType.JSON.value)
response = delete(URL)
checkresponse(response)
pass
# delete
def deleteAllTrainingsession():
URL=baseURL+"/perceptron/trainingsession"
response = delete(URL, headers=ContentType.JSON.value)
response = delete(URL)
checkresponse(response)
pass
# parse arguments
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment