Esempio n. 1
0
            filename_valid = basename + '_valid_' + str(cycle).zfill(3) + '.predict'
            data_io.write(os.path.join(output_dir,filename_valid), Y_valid)
            filename_test = basename + '_test_' + str(cycle).zfill(3) + '.predict'
            data_io.write(os.path.join(output_dir,filename_test), Y_test)
            vprint(verbose,  "[+] Results saved, time spent so far %5.2f sec" % (time.time() - start))         
            time_spent = time.time() - start 
            vprint(verbose,  "[+] End cycle, remaining time %5.2f sec" % (time_budget-time_spent))
            cycle += 1
            time_spent_last = time.time() - begin
            # Remove time spent so far
            time_budget = time_budget - time_spent_last

    if zipme and not(running_on_codalab):
        vprint(verbose, "========= Zipping this directory to "
                        "prepare for submit ==============")
        data_io.zipdir(submission_filename + '.zip', ".")

    overall_time_spent = time.time() - overall_start
    if execution_success:
        vprint(verbose,  "[+] Done")
        vprint(verbose,  "[+] Overall time spent %5.2f sec "
               % overall_time_spent + "::  Overall time budget %5.2f sec"
               % overall_time_budget)
    else:
        vprint(verbose, "[-] Done, but some tasks aborted "
               "because time limit exceeded")
        vprint(verbose, "[-] Overall time spent %5.2f sec "
               % overall_time_spent + " > Overall time budget %5.2f sec"
               % overall_time_budget)

    if running_on_codalab:
Esempio n. 2
0
         vprint( verbose, "======== Saving results to: " + output_dir)
         data_io.write(os.path.join(output_dir,filename_valid), Y_valid)
         data_io.write(os.path.join(output_dir,filename_test), Y_test)
         vprint( verbose,  "[+] Results saved, time spent so far %5.2f sec" % (time.time() - start))
         time_spent = time.time() - start 
         time_left_over = time_budget - time_spent
         vprint( verbose,  "[+] End cycle, time left %5.2f sec" % time_left_over)
         if time_left_over<=0: break
     # Clean up
     del D
     del M
     gc.collect()
         
 if zipme:
     vprint( verbose,  "========= Zipping this directory to prepare for submit ==============")
     data_io.zipdir(submission_filename + '.zip', ".")
     vprint( verbose,  "See: " + submission_filename + '.zip')
 	
 overall_time_spent = time.time() - overall_start
 if execution_success:
     vprint( verbose,  "[+] Done")
     vprint( verbose,  "[+] Overall time spent %5.2f sec " % overall_time_spent + "::  Overall time budget %5.2f sec" % overall_time_budget)
 else:
     vprint( verbose,  "[-] Done, but some tasks aborted because time limit exceeded")
     vprint( verbose,  "[-] Overall time spent %5.2f sec " % overall_time_spent + " > Overall time budget %5.2f sec" % overall_time_budget)
           
 if running_on_codalab: 
     if execution_success:
         exit(0)
     else:
         exit(1)
Esempio n. 3
0
results_dir = 'results/'
problem_dir = 'starting_kit/ingestion_program/'

from sys import path
path.append(problem_dir)
import datetime
from data_io import zipdir

the_date = datetime.datetime.now().strftime("%y-%m-%d-%H-%M")
sample_result_submission = 'sample_result_submission_' + the_date + '.zip'
zipdir(sample_result_submission, results_dir)
print("Submit one of these files (codalab.lri.fr):\n" +
      sample_result_submission)