initExp['args'][
    'algorithm_management_settings'] = algorithm_management_settings
initExp['args']['alg_list'] = alg_list
initExp['args'][
    'instructions'] = 'On each trial, pick the facial expression on the bottom that conveys the same feeling as the one on the top.'
initExp['args']['debrief'] = 'Thanks for participating!'
initExp['app_id'] = 'PoolBasedTripletMDS'
# initExp['site_id'] = 'replace this with working site id'
# initExp['site_key'] = 'replace this with working site key'
initExp['args']['num_tries'] = 50

experiment = {}
experiment['initExp'] = initExp
experiment['target_file'] = curr_dir + "/video_targets.zip"
print "target_file", curr_dir + "/video_targets.zip"
experiment_list.append(experiment)

# Launch the experiment
try:
    AWS_SECRET_ACCESS_KEY = os.environ['AWS_SECRET_ACCESS_KEY']
    AWS_ACCESS_ID = os.environ['AWS_ACCESS_KEY_ID']
    AWS_BUCKET_NAME = os.environ['AWS_BUCKET_NAME']
    host = os.environ['NEXT_BACKEND_GLOBAL_HOST'] + ":" + os.environ.get(
        'NEXT_BACKEND_GLOBAL_PORT', '8000')
except:
    print "You must set AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, NEXT_BACKEND_GLOBAL_HOST as environment variables"
    sys.exit()
exp_uid_list, exp_key_list, widget_key_list = launch_experiment(
    host, experiment_list, AWS_ACCESS_ID, AWS_SECRET_ACCESS_KEY,
    AWS_BUCKET_NAME)
示例#2
0
    AWS_BUCKET_NAME = os.environ['AWS_BUCKET_NAME']
    host = os.environ['NEXT_BACKEND_GLOBAL_HOST'] + \
            ":"+os.environ.get('NEXT_BACKEND_GLOBAL_PORT', '8000')
except:
    print 'The following environment variables must be defined:'

    for key in [
            'AWS_ACCESS_KEY_ID', 'AWS_SECRET_ACCESS_KEY', 'AWS_BUCKET_NAME',
            'NEXT_BACKEND_GLOBAL_HOST'
    ]:
        if key not in os.environ:
            print '    ' + key

    sys.exit()

# Call launch_experiment module found in NEXT/lauch_experiment.py
exp_info = launch_experiment(host, experiment_list, AWS_ACCESS_ID,
                             AWS_SECRET_ACCESS_KEY, AWS_BUCKET_NAME)
exp_uid_list, exp_key_list, widget_key_list = exp_info

# Update the cartoon_dueling.html file wit the exp_uid_list and widget_key_list
# with open('cartoon_tuple.html','r') as page:
#   print "opended file"
#   page_string = page.read()
#   page_string = page_string.replace("{{exp_uid_list}}", str(exp_uid_list))
#   page_string = page_string.replace("{{widget_key_list}}", str(widget_key_list))
#   with open('../../next_frontend_base/next_frontend_base/templates/cartoon_tuple.html','w') as out:
#     out.write(page_string)
#     out.flush()
#     out.close()
示例#3
0
# initExp['args']['instructions'] = ''
# initExp['args']['debrief'] = ''
initExp['args']['num_tries'] = 50
initExp['app_id'] = 'DuelingBanditsPureExploration'
initExp['site_id'] = 'replace this with working site id'
initExp['site_key'] = 'replace this with working site key'

# Set the context   
experiment = {}
experiment['initExp'] = initExp
experiment['primary_type'] = 'text'
experiment['primary_target_file'] = curr_dir+"/cap436.txt"
experiment['context'] = curr_dir+"/cap436.jpg"
experiment['context_type'] = 'image'
experiment_list.append(experiment)

# Launch the experiment
try:
  AWS_SECRET_ACCESS_KEY = os.environ['AWS_SECRET_ACCESS_KEY']
  AWS_ACCESS_ID = os.environ['AWS_ACCESS_KEY_ID']
  AWS_BUCKET_NAME = os.environ['AWS_BUCKET_NAME']
  host = os.environ['NEXT_BACKEND_GLOBAL_HOST']+":"+os.environ.get('NEXT_BACKEND_GLOBAL_PORT', '8000')

except:
  print "You must set AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, NEXT_BACKEND_GLOBAL_HOST as environment variables"
  sys.exit()

# Call launch_experiment module found in NEXT/lauch_experiment.py
exp_uid_list, exp_key_list, widget_key_list = launch_experiment(host, experiment_list, AWS_ACCESS_ID, AWS_SECRET_ACCESS_KEY, AWS_BUCKET_NAME)

示例#4
0
    initExp['args'] = {}
    initExp['args']['pretest_count'] = 2
    initExp['args']['training_count'] = 6
    initExp['args']['posttest_count'] = 4
    initExp['args']['guard_gap'] = 5
    initExp['args'][
        'participant_to_algorithm_management'] = 'one_to_one'  # assign one participant to one condition only
    initExp['args'][
        'algorithm_management_settings'] = algorithm_management_settings
    initExp['args']['alg_list'] = alg_list
    initExp['args'][
        'instructions'] = 'Do not click back or refresh the page!!!'
    initExp['args'][
        'debrief'] = 'Thank you for your participation <a href="www.google.com" target="_blank">here</a>. Your response has been recorded.'
    # the number of questions the participant will see, this value will be calculated by adding pretest_count, training_count and posttest_count
    initExp['args']['num_tries'] = 1
    initExp['app_id'] = 'MoleculeEquivalence'

    curr_dir = os.path.dirname(os.path.abspath(__file__))
    experiment = {}
    experiment['initExp'] = initExp
    experiment['primary_type'] = 'json-urls'
    experiment['primary_target_file'] = target_file
    experiment_list.append(experiment)

    # Launch the experiment
    host = "localhost:8000"
    print "It's happening"
    exp_uid_list = launch_experiment(host, experiment_list)
    print "Made experiments {}".format(exp_uid_list)
示例#5
0
initExp['args']['alg_list'] = alg_list 
initExp['args']['instructions'] = 'Test instructions'
initExp['args']['debrief'] = 'Test debrief'
initExp['app_id'] = 'PoolBasedTripletMDS'
#initExp['site_id'] = 'replace this with working site id'
#initExp['site_key'] = 'replace this with working site key'


curr_dir = os.path.dirname(os.path.abspath(__file__))
experiment = {}
experiment['initExp'] = initExp
experiment['primary_type'] = 'image'
experiment['primary_target_file'] = sys.argv[1]
experiment_list.append(experiment)

# Launch the experiment
host = "localhost:8000"
print "It's happening"
exp_uid_list = launch_experiment(host, experiment_list)
print "Made experiments {}".format(exp_uid_list)
# Update the cartoon_dueling.html file wit the exp_uid_list and widget_key_list
# with open('strange_fruit_triplet.html','r') as page:
#   print "opended file"
#   page_string = page.read()
#   page_string = page_string.replace("{{exp_uid_list}}", str(exp_uid_list))
#   page_string = page_string.replace("{{widget_key_list}}", str(widget_key_list))
#   with open('../../next_frontend_base/next_frontend_base/templates/strange_fruit_triplet.html','w') as out:
#     out.write(page_string)
#     out.flush()
#     out.close()
# Set the context. When decided between two funny captions, the context is the
# comic the caption is for. This is static and does not change query-to-query.
experiment = {}
experiment["initExp"] = initExp
experiment["primary_type"] = "text"
experiment["primary_target_file"] = curr_dir + "/cap436.txt"
experiment["context"] = curr_dir + "/cap436.jpg"
experiment["context_type"] = "image"
experiment_list.append(experiment)

# Launch the experiment.
try:
    AWS_SECRET_ACCESS_KEY = os.environ["AWS_SECRET_ACCESS_KEY"]
    AWS_ACCESS_ID = os.environ["AWS_ACCESS_KEY_ID"]
    AWS_BUCKET_NAME = os.environ["AWS_BUCKET_NAME"]
    host = os.environ["NEXT_BACKEND_GLOBAL_HOST"] + ":" + os.environ.get("NEXT_BACKEND_GLOBAL_PORT", "8000")

except:
    print "The following environment variables must be defined:"

    for key in ["AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY", "AWS_BUCKET_NAME", "NEXT_BACKEND_GLOBAL_HOST"]:
        if key not in os.environ:
            print "    " + key

    sys.exit()


# Call launch_experiment module found in NEXT/lauch_experiment.py
exp_info = launch_experiment(host, experiment_list, AWS_ACCESS_ID, AWS_SECRET_ACCESS_KEY, AWS_BUCKET_NAME)
exp_uid_list, exp_key_list, widget_key_list = exp_info
initExp['args']['alg_list'] = alg_list
initExp['args']['instructions'] = 'Test instructions'
initExp['args']['debrief'] = 'Test debrief'
initExp['app_id'] = 'PoolBasedTripletMDS'
initExp['site_id'] = 'replace this with working site id'
initExp['site_key'] = 'replace this with working site key'

curr_dir = os.path.dirname(os.path.abspath(__file__))
experiment = {}
experiment['initExp'] = initExp
experiment['primary_type'] = 'image'
experiment['primary_target_file'] = sys.argv[1]
experiment_list.append(experiment)

# Launch the experiment
host = "localhost:8000"
print "It's happening"
exp_uid_list, exp_key_list, widget_key_list = launch_experiment(
    host, experiment_list)
print exp_uid_list, exp_key_list, widget_key_list
# Update the cartoon_dueling.html file wit the exp_uid_list and widget_key_list
# with open('strange_fruit_triplet.html','r') as page:
#   print "opended file"
#   page_string = page.read()
#   page_string = page_string.replace("{{exp_uid_list}}", str(exp_uid_list))
#   page_string = page_string.replace("{{widget_key_list}}", str(widget_key_list))
#   with open('../../next_frontend_base/next_frontend_base/templates/strange_fruit_triplet.html','w') as out:
#     out.write(page_string)
#     out.flush()
#     out.close()
initExp['args']['alg_list'] = alg_list 
initExp['args']['instructions'] = 'Test instructions'
initExp['args']['debrief'] = 'Test debrief'
initExp['app_id'] = 'PoolBasedTripletMDS'
initExp['site_id'] = 'replace this with working site id'
initExp['site_key'] = 'replace this with working site key'


curr_dir = os.path.dirname(os.path.abspath(__file__))
experiment = {}
experiment['initExp'] = initExp
experiment['primary_type'] = 'image'
experiment['primary_target_file'] = sys.argv[1]
experiment_list.append(experiment)

# Launch the experiment
host = "localhost:8000"
print "It's happening"
exp_uid_list, exp_key_list, widget_key_list = launch_experiment(host, experiment_list)
print exp_uid_list, exp_key_list, widget_key_list
# Update the cartoon_dueling.html file wit the exp_uid_list and widget_key_list
# with open('strange_fruit_triplet.html','r') as page:
#   print "opended file"
#   page_string = page.read()
#   page_string = page_string.replace("{{exp_uid_list}}", str(exp_uid_list))
#   page_string = page_string.replace("{{widget_key_list}}", str(widget_key_list))
#   with open('../../next_frontend_base/next_frontend_base/templates/strange_fruit_triplet.html','w') as out:
#     out.write(page_string)
#     out.flush()
#     out.close()