This repository has been archived by the owner on Sep 26, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Start implementing a test view * Put the trained model path on the Job. Add a load test data plugin to load example datasets. Refine the load test data plugin input format. * Simplify ResultFragment * Fix tracking the trained model file * Fix the trained model filename and test plugins * Show existing test results * Add show file support * Fix a bug not setting the internal training method * Shorten test result filenames. Write test runner errors to a log file the user can read. * Clean up test view ui * Fix LocalTestRunnerIntegTest * Remove ModelSource.FromJob * Load CSV files into a linechart in ResultFragment.kt * Update the CLI * Add image support in ResultFragment.kt Co-authored-by: Austin Shalit <[email protected]>
- Loading branch information
1 parent
789390e
commit 7877834
Showing
30 changed files
with
756 additions
and
210 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
plugin/src/main/kotlin/edu/wpi/axon/plugin/LoadTestDataPlugins.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package edu.wpi.axon.plugin | ||
|
||
object LoadTestDataPlugins { | ||
|
||
// TODO: Don't hardcode which element to return | ||
val loadExampleDatasetPlugin = Plugin.Official( | ||
"Load an Example Dataset", | ||
""" | ||
|def load_test_data(input): | ||
| import json | ||
| loaded_json = json.loads(input) | ||
| | ||
| try: | ||
| type = loaded_json["example_dataset"] | ||
| if type == "boston_housing": | ||
| dataset = tf.keras.datasets.boston_housing | ||
| elif type == "cifar10": | ||
| dataset = tf.keras.datasets.cifar10 | ||
| elif type == "cifar100": | ||
| dataset = tf.keras.datasets.cifar100 | ||
| elif type == "fashion_mnist": | ||
| dataset = tf.keras.datasets.fashion_mnist | ||
| elif type == "imdb": | ||
| dataset = tf.keras.datasets.imdb | ||
| elif type == "mnist": | ||
| dataset = tf.keras.datasets.mnist | ||
| elif type == "reuters": | ||
| dataset = tf.keras.datasets.reuters | ||
| else: | ||
| raise RuntimeError("Cannot load the dataset.") | ||
| except KeyError: | ||
| raise RuntimeError("Cannot load the dataset.") | ||
| | ||
| (x_train, y_train), (x_test, y_test) = dataset.load_data() | ||
| x_test = x_test[:1] | ||
| x_test = tf.cast(x_test / 255, tf.float32) | ||
| x_test = x_test[..., tf.newaxis] | ||
| return (x_test, y_test[:1], 1) | ||
""".trimMargin() | ||
) | ||
} |
19 changes: 19 additions & 0 deletions
19
plugin/src/main/kotlin/edu/wpi/axon/plugin/ProcessTestOutputPlugins.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package edu.wpi.axon.plugin | ||
|
||
object ProcessTestOutputPlugins { | ||
|
||
val serializeModelOutputPlugin = Plugin.Official( | ||
"Serialize Model Output", | ||
""" | ||
|def process_model_output(model_input, expected_output, model_output): | ||
| # import json | ||
| import numpy as np | ||
| with open("output/expected_output.txt", "w+") as f: | ||
| # json.dump(expected_output, f) | ||
| np.savetxt(f, expected_output) | ||
| with open("output/model_output.txt", "w+") as f: | ||
| # json.dump(model_output, f) | ||
| np.savetxt(f, model_output) | ||
""".trimMargin() | ||
) | ||
} |
Oops, something went wrong.