diff --git a/backend/auto_augmentation/progress.py b/backend/auto_augmentation/progress.py index 25610485b54fdcec657508c029ddc06a48cf321c..abd4a175b82f4f42332f53ded9ac04084e58c2b8 100644 --- a/backend/auto_augmentation/progress.py +++ b/backend/auto_augmentation/progress.py @@ -31,6 +31,11 @@ def response(): # hyperparameters to change # print("thing: ", request.files['dataset_upload'] ) if request.method == 'POST': + + exclude_method = request.form.getlist("action_space") + num_funcs = len(exclude_method) + + batch_size = 1 # size of batch the inner NN is trained with learning_rate = 1e-1 # fix learning rate ds = request.form.get("dataset_selection") # pick dataset (MNIST, KMNIST, FashionMNIST, CIFAR10, CIFAR100) @@ -76,9 +81,10 @@ def response(): # save('best_q_values_{}_{}percent_{}.npy'.format(IsLeNet, int(toy_size*100), ds), best_q_values) #best_q_values = load('best_q_values_{}_{}percent_{}.npy'.format(IsLeNet, int(toy_size*100), ds), allow_pickle=True) print("DONE") + print("HEREHERE exclude_method: ", exclude_method) - return render_template("progress.html") + return render_template("progress.html", exclude_method = exclude_method) diff --git a/backend/auto_augmentation/templates/home.html b/backend/auto_augmentation/templates/home.html index 2e3000dbec4fd82e6f2ebfb8c2e70eeab7429041..062e056bcd361b49ebab002e23001485ac03987e 100644 --- a/backend/auto_augmentation/templates/home.html +++ b/backend/auto_augmentation/templates/home.html @@ -71,7 +71,7 @@ <h3>Advanced Search</h3> <!-- action(data augmentation) space --> - Which data augmentation method you would like exclude? <br> + Which data augmentation method you would like exclude? <br> <br> <input type="checkbox" id="ShearX" name="action_space" value="ShearX"> <label for="ShearX">ShearX</label> @@ -89,7 +89,7 @@ <label for="TranslateY">TranslateY</label> <input type="checkbox" id="Rotate" - name="Rotate" value="Rotate"> + name="action_space" value="Rotate"> <label for="Rotate">Rotate</label><br> <input type="checkbox" id="Brightness" @@ -129,79 +129,87 @@ <label for="Invert">Invert</label><br><br><br> - - <div id="like_button_container"></div> - <script src="https://unpkg.com/react@18/umd/react.development.js" crossorigin></script> - <script src="https://unpkg.com/react-dom@18/umd/react-dom.development.js" crossorigin></script> - <!-- <script src="metarl/auto_augmentation/templates/like_button.js"></script> --> + + <!-- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script> --> + <!-- <link rel="stylesheet" href="multiselect/jquery.multiselect.css"> --> + <!-- <script src="multiselect/jquery.multiselect.js"></script> --> + <!-- <div class="container"> --> + <!-- <select name="langOpt[]" multiple id="langOpt"> --> + <!-- <option value="C++">C++</option> --> + <!-- <option value="C#">C#</option> --> + <!-- <option value="Java">Java</option> --> + <!-- <option value="Objective-C">Objective-C</option> --> + <!-- <option value="JavaScript">JavaScript</option> --> + <!-- <option value="Perl">Perl</option> --> + <!-- <option value="PHP">PHP</option> --> + <!-- <option value="Ruby on Rails">Ruby on Rails</option> --> + <!-- <option value="Android">Android</option> --> + <!-- <option value="iOS">iOS</option> --> + <!-- <option value="HTML">HTML</option> --> + <!-- <option value="XML">XML</option> --> + <!-- </select> --> + <!-- <script> --> + <!-- $('select[multiple]').multiselect(); --> + <!-- $('#langOpt').multiselect({ --> + <!-- columns: 1, --> + <!-- placeholder: 'Select Languages' --> +<!-- }); --> + <!-- </script> --> + <!-- </div> --> + + + <!-- <div id="like_button_container"></div> --> + <!-- <script src="https://unpkg.com/react@18/umd/react.development.js" crossorigin></script> --> + <!-- <script src="https://unpkg.com/react-dom@18/umd/react-dom.development.js" crossorigin></script> --> + <!-- <script src="metarl/auto_augmentation/templates/like_button.js"></script> --> <script type = 'module'> // 'use strict'; - import React from 'react'; - import ReactDOM from "react-dom/client"; - </script> - - - <script> - const e = React.createElement; - - var path = document.location.pathname; - var directory = path.substring(path.indexOf('/'), path.lastIndexOf('/')); - // var loc = window.location.pathname; - - - - class LikeButton extends React.Component { - constructor(props) { - super(props); - this.state = { liked: false }; - } - - render() { - if (this.state.liked) { - return 'You liked this.'; - } - - return e( - 'button', - { onClick: () => this.setState({ liked: true }) }, - 'Like' - ); - } - } - - - const domContainer = document.querySelector('#like_button_container'); - const root = ReactDOM.createRoot(domContainer); - root.render(e(LikeButton)); - + // import React from 'react'; + // import ReactDOM from "react-dom/client"; </script> + <!-- <script> --> + <!-- // const e = React.createElement; + // var path = document.location.pathname; + // var directory = path.substring(path.indexOf('/'), path.lastIndexOf('/')); + // // var loc = window.location.pathname; + // class LikeButton extends React.Component { + // constructor(props) { + // super(props); + // this.state = { liked: false }; + // } + // render() { + // if (this.state.liked) { + // return 'You liked this.'; + // } + // return e( + // 'button', + // { onClick: () => this.setState({ liked: true }) }, + // 'Like' + // ); + // } + // } + // const domContainer = document.querySelector('#like_button_container'); + // const root = ReactDOM.createRoot(domContainer); + // root.render(e(LikeButton)); --> + <!-- </script> --> - - - <!-- 3 <div id="mydiv"></div> - <script type="text/babel" type="javascript"> import ReactDOM from 'react-dom'; function Hello() { return <h1>Hello World!</h1>; } - ReactDOM.render(<Hello />, document.getElementById('mydiv')) </script> 3 --> - - <!-- ----------------- --> - - <!-- <script src="https://unpkg.com/react@16/umd/react.production.min.js" crossorigin @@ -222,14 +230,6 @@ - - - - - - - - <input type="submit"> diff --git a/backend/auto_augmentation/templates/progress.html b/backend/auto_augmentation/templates/progress.html index 7228b06b1c398e6d55b5472b47dd0db2d304bea8..10ba2d4ffdfdbee3bb1ef773904a9c2f044c8a4b 100644 --- a/backend/auto_augmentation/templates/progress.html +++ b/backend/auto_augmentation/templates/progress.html @@ -1,6 +1,15 @@ {% extends "basic.html" %} {% block title%}Progress{% endblock %} {% block body %} + + +<ul> +Excluded methods: + {% for method in exclude_method %} + {{method}}, + {% endfor %} + +</ul> Training the model... <div>