Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Functions to serialize and deserialize results #123

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

nitinjain96
Copy link
Contributor

@nitinjain96 nitinjain96 commented Apr 15, 2023

This PR accomplishes 2 tasks:

  • Adding the ability to save the results from our runs.
  • Automating the process of registering and running tasks by modifying a simple JSON file.

Saving model results

Need:

We need to save our model evaluation results in a format that can be used later. This would make the results readily available and would save us the trouble of running the tasks multiple times to get those results.

Solution:

Added serializing and deserializing functions for the results and all relevant classes to be able to save those results as a valid JSON string which can be deserialized later on for further use.

Note: Pickle was tried earlier but the data kept getting corrupted without a tangible solution available. Hence, we shifted to using this strategy for saving the results.

Running tasks through a config JSON file

Need:

At present, having to run tasks is a cumbersome process of having to write the code for importing individual classes and the model and calling evaluate.

Solution:

This can be automated through a script that reads our task requirements from a JSON file and generates the aforementioned Python file for us to run. The PR adds:

  • tasks_config.json:
    A config file containing information on the tasks and model. This is the only file we'll need to edit after this change to run tasks. The user needs to add the appropriate username and path for out_file_location and relative_data_folder before being able to use the script.
  • make_script.py:
    The script which would parse tasks_config.json and create the Python file run_tasks.py for the scheduler to run.
  • run.sh:
    The shell file which is specified in the scheduler script. It runs make_script.py and run_tasks.py in succession.

@nitinjain96 nitinjain96 marked this pull request as draft April 29, 2023 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant