Commit 97001323 authored by ymir's avatar ymir

request all perceptron

parent 1f255500
......@@ -8,7 +8,7 @@ ls -lh ${PERCEPTRON_FILE}
-> create
PERCEPTRON_ID=`python3 neuralnetworktrainercli.py create perceptron -a ${PERCEPTRON_FILE}`
echo ${PERCEPTRON_ID}
-> read
-> read single
rm ${PERCEPTRON_FILE}
python3 neuralnetworktrainercli.py read perceptron -i ${PERCEPTRON_ID} -a ${PERCEPTRON_FILE}
ls -lh ${PERCEPTRON_FILE}
......@@ -18,8 +18,17 @@ python3 neuralnetworktrainercli.py update perceptron -i ${PERCEPTRON_ID} -a ${PE
python3 neuralnetworktrainercli.py patch perceptron -i ${PERCEPTRON_ID} -c "patched perceptron"
-> summarize
python3 neuralnetworktrainercli.py summarize perceptron -i ${PERCEPTRON_ID}
-> delete
-> delete single
python3 neuralnetworktrainercli.py delete perceptron -i ${PERCEPTRON_ID}
-> read all
for i in {0..7}
do
python3 neuralnetworktrainercli.py randomize perceptron -d 1 1 -a ${PERCEPTRON_FILE}
python3 neuralnetworktrainercli.py create perceptron -a ${PERCEPTRON_FILE}
done
python3 neuralnetworktrainercli.py read perceptron
-> delete all
python3 neuralnetworktrainercli.py delete perceptron
***** TRAINING SET *****
***** TRAINING SESSION *****
***** TRAINER *****
......
......@@ -65,13 +65,20 @@ def createPerceptron(archive):
checkresponse(response)
print(response.text)
pass
# read perceptron
def readPerceptron(id,archive):
# read single perceptron
def readSinglePerceptron(id,archive):
URL=baseURL+"/perceptron/"+str(id)
response = get(URL, headers=ContentType.GZIP.value)
checkresponse(response)
dumpArchive(archive, response.content)
pass
# read all perceptron
def readAllPerceptron():
URL=baseURL+"/perceptron"
response = get(URL, headers=ContentType.JSON.value)
checkresponse(response)
print(response.text)
pass
# update perceptron
def updatePerceptron(id,archive):
URL=baseURL+"/perceptron/"+str(id)
......@@ -93,21 +100,29 @@ def summarizePerceptron(id):
checkresponse(response)
print(response.text)
pass
# delete perceptron
def deletePerceptron(id):
# delete single perceptron
def deleteSinglePerceptron(id):
URL=baseURL+"/perceptron/"+str(id)
response = delete(URL, headers=ContentType.JSON.value)
checkresponse(response)
pass
# delete all perceptron
def deleteAllPerceptron():
URL=baseURL+"/perceptron"
response = delete(URL, headers=ContentType.JSON.value)
checkresponse(response)
pass
# parse arguments
def dispatchRequest(arguments):
if arguments.action.upper()=="RANDOMIZE" and arguments.resource.upper()=="PERCEPTRON": randomizePerceptron(arguments.dimensions,arguments.comments,arguments.archive)
elif arguments.action.upper()=="CREATE" and arguments.resource.upper()=="PERCEPTRON": createPerceptron(arguments.archive)
elif arguments.action.upper()=="READ" and arguments.resource.upper()=="PERCEPTRON": readPerceptron(arguments.id,arguments.archive)
elif arguments.action.upper()=="READ" and arguments.resource.upper()=="PERCEPTRON" and arguments.id: readSinglePerceptron(arguments.id,arguments.archive)
elif arguments.action.upper()=="READ" and arguments.resource.upper()=="PERCEPTRON": readAllPerceptron()
elif arguments.action.upper()=="UPDATE" and arguments.resource.upper()=="PERCEPTRON": updatePerceptron(arguments.id,arguments.archive)
elif arguments.action.upper()=="PATCH" and arguments.resource.upper()=="PERCEPTRON": patchPerceptron(arguments.id,arguments.comments)
elif arguments.action.upper()=="SUMMARIZE" and arguments.resource.upper()=="PERCEPTRON": summarizePerceptron(arguments.id)
elif arguments.action.upper()=="DELETE" and arguments.resource.upper()=="PERCEPTRON": deletePerceptron(arguments.id)
elif arguments.action.upper()=="DELETE" and arguments.resource.upper()=="PERCEPTRON" and arguments.id: deleteSinglePerceptron(arguments.id)
elif arguments.action.upper()=="DELETE" and arguments.resource.upper()=="PERCEPTRON": deleteAllPerceptron()
else: raise Exception("couple action/resource does not match : " + arguments.action + "/" + arguments.resource)
pass
# run program
......
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