Пример #1
0
def do_predict(request, network_id, inputs_dataset_id):
    network = Network.objects.get(pk=network_id)
    if request.user == network.user :
        result = Result()
        result.action = 'prediction'
        result.updated_at = timezone.now()
        result.save()
        t = threading.Thread(target=predict, args=(network_id, result.id, inputs_dataset_id))
        t.setDaemon(True)
        t.start()
        return redirect('/dnn/result/' + str(result.id))
    else :
        raise PermissionDenied
Пример #2
0
def do_train(request, network_id, inputs_dataset_id, targets_dataset_id, batch_size, epochs):
    network = Network.objects.get(pk=network_id)
    if request.user == network.user :
        result = Result()
        result.action = 'training'
        result.updated_at = timezone.now()
        result.save()
        t = threading.Thread(target=train, args=(network_id, result.id, inputs_dataset_id, targets_dataset_id, int(batch_size), int(epochs)))
        t.setDaemon(True)
        t.start()
        return redirect('/dnn/result/' + str(result.id))
    else :
        raise PermissionDenied
Пример #3
0
def do_predict(request, network_id, inputs_dataset_id):
    network = Network.objects.get(pk=network_id)
    if request.user == network.user:
        result = Result()
        result.action = 'prediction'
        result.updated_at = timezone.now()
        result.save()
        t = threading.Thread(target=predict,
                             args=(network_id, result.id, inputs_dataset_id))
        t.setDaemon(True)
        t.start()
        return redirect('/dnn/result/' + str(result.id))
    else:
        raise PermissionDenied
Пример #4
0
def do_validate(request, network_id, inputs_dataset_id, targets_dataset_id,
                batch_size, epochs):
    network = Network.objects.get(pk=network_id)
    if request.user == network.user:
        result = Result()
        result.action = 'validation'
        result.updated_at = timezone.now()
        result.save()
        #raise Exception("hello")
        t = threading.Thread(target=validate,
                             args=(network_id, result.id, inputs_dataset_id,
                                   targets_dataset_id, int(batch_size)))
        t.setDaemon(True)
        t.start()
        return redirect('/dnn/result/' + str(result.id))
    else:
        raise PermissionDenied