Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
222 lines (195 sloc) 8.89 KB
<!doctype html>
<html>
<head>
<%- include('head'); %>
</head>
<body>
<%- include('nav'); %>
<main role="main" class="container">
<div class="row">
<form action="/model/<%= locals.model.id || 0 %>/options" method="post" enctype="multipart/form-data"
class="my-3 col-sm-8 offset-sm-2 col-lg-6 offset-lg-3">
<h1 class="h3 text-center mb-3">Update training options</h1>
<p class="lead">
Following training options are going to be used to train on uploaded textual data.
</p>
<% if(locals.errors){ %>
<p class="alert alert-warning">
Form contains errors
</p>
<% } %>
<fieldset>
<legend>Training options</legend>
<div class="form-group row">
<label for="num_seqs" class="col-sm-6 col-form-label">Number of seqs in one batch</label>
<div class="col-sm-6">
<input name="num_seqs" placeholder="Default: 32" type="number" id="num_seqs"
class="form-control <% if(fieldErr("num_seqs")){ %>is-invalid<% } %>"
min="1"
value="<%=fieldData("num_seqs")%>">
<% if(fieldErr("num_seqs")){ %>
<div class="invalid-feedback"><%= fieldErr("num_seqs") %></div>
<% } %>
</div>
</div>
<div class="form-group row">
<label for="num_steps" class="col-sm-6 col-form-label">Length of one seq</label>
<div class="col-sm-6">
<input name="num_steps" placeholder="Default: 50" type="number" id="num_steps"
class="form-control <% if(fieldErr("num_steps")){ %>is-invalid<% } %>"
min="1"
value="<%=fieldData("num_steps")%>">
<% if(fieldErr("num_steps")){ %>
<div class="invalid-feedback"><%= fieldErr("num_steps") %></div>
<% } %>
</div>
</div>
<div class="form-group row">
<label for="lstm_size" class="col-sm-6 col-form-label">Size of hidden state of LSTM</label>
<div class="col-sm-6">
<input name="lstm_size" placeholder="Default: 128" type="number" id="lstm_size"
class="form-control <% if(fieldErr("lstm_size")){ %>is-invalid<% } %>"
min="0"
value="<%=fieldData("lstm_size")%>">
<% if(fieldErr("lstm_size")){ %>
<div class="invalid-feedback"><%= fieldErr("lstm_size") %></div>
<% } %>
</div>
</div>
<div class="form-group row">
<label for="num_layers" class="col-sm-6 col-form-label">Number of LSTM layers</label>
<div class="col-sm-6">
<input name="num_layers" placeholder="Default: 2" type="number" id="num_layers"
class="form-control <%if(fieldErr("num_layers")){%>is-invalid<%}%>"
min="0"
value="<%=fieldData("num_layers")%>">
<% if(fieldErr("num_layers")){ %>
<div class="invalid-feedback"><%= fieldErr("num_layers") %></div>
<% } %>
</div>
</div>
<div class="form-group row">
<label for="use_embedding" class="col-sm-6 col-form-label">Use embedding?</label>
<div class="col-sm-6">
<div class="form-check">
<input class="form-check-input" type="radio"
name="use_embedding" id="use_embedding1"
value="true"
<% if(fieldData("use_embedding")===true){%>checked<%}%>>
<label class="form-check-label" for="use_embedding1">
Yes
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio"
name="use_embedding" id="use_embedding2"
value="false"
<% if(fieldData("use_embedding")===false){%>checked<%}%>>
<label class="form-check-label" for="use_embedding2">
No (default)
</label>
</div>
<% if(fieldErr("use_embedding")){ %>
<div class="invalid-feedback"><%= fieldErr("use_embedding") %></div>
<% } %>
</div>
</div>
<div class="form-group row">
<label for="embedding_size" class="col-sm-6 col-form-label">Size of embedding</label>
<div class="col-sm-6">
<input name="embedding_size" placeholder="Default: 128" type="number" id="embedding_size"
class="form-control <%if(fieldErr("embedding_size")){%>is-invalid<%}%>"
min="1"
value="<%=fieldData("embedding_size")%>">
<% if(fieldErr("embedding_size")){ %>
<div class="invalid-feedback"><%= fieldErr("embedding_size") %></div>
<% } %>
</div>
</div>
<div class="form-group row">
<label for="learning_rate" class="col-sm-6 col-form-label">Learning rate</label>
<div class="col-sm-6">
<input name="learning_rate" placeholder="Default: 0.001" type="number" id="learning_rate"
class="form-control <%if(fieldErr("learning_rate")){%>is-invalid<%}%>"
min="0"
max="1"
step="0.0001"
value="<%=fieldData("learning_rate")%>">
<% if(fieldErr("learning_rate")){ %>
<div class="invalid-feedback"><%= fieldErr("learning_rate") %></div>
<% } %>
</div>
</div>
<div class="form-group row">
<label for="train_keep_prob" class="col-sm-6 col-form-label">Dropout rate during training</label>
<div class="col-sm-6">
<input name="train_keep_prob" placeholder="Default: 0.5" type="number" id="train_keep_prob"
class="form-control <%if(fieldErr("train_keep_prob")){%>is-invalid<%}%>"
min="0"
max="1"
step="0.01"
value="<%=fieldData("train_keep_prob")%>">
<% if(fieldErr("train_keep_prob")){ %>
<div class="invalid-feedback"><%= fieldErr("train_keep_prob") %></div>
<% } %>
</div>
</div>
<div class="form-group row">
<label for="max_steps" class="col-sm-6 col-form-label">Max steps to train</label>
<div class="col-sm-6">
<input name="max_steps" placeholder="Default: 1000" type="number" id="max_steps"
class="form-control <%if(fieldErr("max_steps")){%>is-invalid<%}%>"
min="1"
value="<%=fieldData("max_steps")%>">
<% if(fieldErr("max_steps")){ %>
<div class="invalid-feedback"><%= fieldErr("max_steps") %></div>
<% } %>
</div>
</div>
<div class="form-group row">
<label for="save_every_n" class="col-sm-6 col-form-label">Save the model every n steps</label>
<div class="col-sm-6">
<input name="save_every_n" placeholder="Default: 1000" type="number" id="save_every_n"
class="form-control <%if(fieldErr("save_every_n")){%>is-invalid<%}%>"
min="1"
value="<%=fieldData("save_every_n")%>">
<% if(fieldErr("save_every_n")){ %>
<div class="invalid-feedback"><%= fieldErr("save_every_n") %></div>
<% } %>
</div>
</div>
<div class="form-group row">
<label for="log_every_n" class="col-sm-6 col-form-label">Log to the screen every n steps</label>
<div class="col-sm-6">
<input name="log_every_n" placeholder="Default: 100" type="number" id="log_every_n"
class="form-control <%if(fieldErr("log_every_n")){%>is-invalid<%}%>"
min="1"
value="<%=fieldData("log_every_n")%>">
<% if(fieldErr("log_every_n")){ %>
<div class="invalid-feedback"><%= fieldErr("log_every_n") %></div>
<% } %>
</div>
</div>
<div class="form-group row">
<label for="max_vocab" class="col-sm-6 col-form-label">Max char number from training file</label>
<div class="col-sm-6">
<input name="max_vocab" placeholder="Default: 3500" type="number" id="max_vocab"
class="form-control <%if(fieldErr("max_vocab")){%>is-invalid<%}%>"
min="1"
value="<%=fieldData("max_vocab")%>">
<% if(fieldErr("max_vocab")){ %>
<div class="invalid-feedback"><%= fieldErr("max_vocab") %></div>
<% } %>
</div>
</div>
</fieldset>
<hr class="mt-5">
<div class="text-right">
<a href="/model/<%= locals.model.id %>" class="btn btn-outline-secondary">Cancel</a>
<button type="submit" class="btn btn-primary">Update</button>
</div>
</form>
</div>
</main>
</body>
</html>