109 lines
5.2 KiB
HTML
109 lines
5.2 KiB
HTML
<section class="train">
|
|
<h3 class="train__title">Parámetros del entrenamiento</h3>
|
|
@if (cohortsError(); as error) {
|
|
<p class="train__alert" role="alert"><mat-icon aria-hidden="true">error</mat-icon>{{ error }}</p>
|
|
}
|
|
<form class="train__form" [formGroup]="form" (ngSubmit)="train()">
|
|
<mat-form-field appearance="outline" subscriptSizing="dynamic">
|
|
<mat-label>Cohorte de referencia</mat-label>
|
|
<mat-select formControlName="reference_name">
|
|
<mat-option value="">La que use el servidor</mat-option>
|
|
@for (cohort of cohorts(); track cohort.name) {
|
|
<mat-option [value]="cohort.name">{{ cohort.name }} ({{ cohort.edfs }} EDF)</mat-option>
|
|
}
|
|
</mat-select>
|
|
</mat-form-field>
|
|
<mat-form-field appearance="outline" subscriptSizing="dynamic">
|
|
<mat-label>Carpeta en el clúster</mat-label>
|
|
<input matInput formControlName="reference_dir" placeholder="/datos/tea/referencia" />
|
|
<mat-hint>Ruta absoluta; se usa cuando no hay cohorte elegida.</mat-hint>
|
|
</mat-form-field>
|
|
<mat-form-field appearance="outline" subscriptSizing="dynamic">
|
|
<mat-label>Tabla de edades en el clúster</mat-label>
|
|
<input matInput formControlName="reference_ages" placeholder="/referencia/helsinki/edades.csv" />
|
|
<mat-hint>Opcional. Sin ella, la edad sale de la cabecera de cada EDF.</mat-hint>
|
|
</mat-form-field>
|
|
<mat-button-toggle-group formControlName="line_hz" aria-label="Frecuencia de línea eléctrica">
|
|
<mat-button-toggle [value]="50">50 Hz</mat-button-toggle>
|
|
<mat-button-toggle [value]="60">60 Hz</mat-button-toggle>
|
|
</mat-button-toggle-group>
|
|
<mat-checkbox formControlName="promote">Promover al terminar</mat-checkbox>
|
|
<button mat-flat-button type="submit" color="primary" [disabled]="starting() || running() || jobsLoading()">
|
|
<mat-icon aria-hidden="true">model_training</mat-icon>
|
|
{{ starting() ? 'Iniciando…' : 'Entrenar' }}
|
|
</button>
|
|
</form>
|
|
@if (startError(); as error) {
|
|
<p class="train__alert" role="alert"><mat-icon aria-hidden="true">error</mat-icon>{{ error }}</p>
|
|
}
|
|
|
|
<h3 class="train__title">Entrenamientos</h3>
|
|
@if (jobsError(); as error) {
|
|
<p class="train__alert" role="alert">{{ error }}</p>
|
|
<button mat-button type="button" [disabled]="jobsLoading()" (click)="refreshJobs()">Volver a consultar</button>
|
|
}
|
|
@if (jobs().length) {
|
|
<ul class="train__jobs">
|
|
@for (job of jobs(); track job.id) {
|
|
<li>
|
|
<span class="train__state" [class.train__state--run]="job.estado === 'en_curso'">
|
|
<mat-icon aria-hidden="true">{{ job.estado === 'en_curso' ? 'hourglass_top' : job.estado === 'fallido' ? 'error' : 'check_circle' }}</mat-icon>
|
|
{{ estados[job.estado] }}
|
|
</span>
|
|
<span class="train__meta">{{ job.scenario }} · {{ job.iniciado | date: 'medium' }}</span>
|
|
@if (monitorIds().includes(job.id)) {
|
|
<app-run-monitor kind="train" [jobId]="job.id" [running]="job.estado === 'en_curso'" />
|
|
} @else {
|
|
<details class="train__output" #progress (toggle)="progressOpen.set(job.id, progress.open)">
|
|
<summary>Ver progreso</summary>
|
|
@if (progressOpen.get(job.id)) { <app-run-monitor kind="train" [jobId]="job.id" /> }
|
|
</details>
|
|
}
|
|
@if (job.salida) {
|
|
<details class="train__output">
|
|
<summary>Ver salida</summary>
|
|
<pre>{{ job.salida }}</pre>
|
|
</details>
|
|
}
|
|
</li>
|
|
}
|
|
</ul>
|
|
} @else if (jobsLoading()) {
|
|
<mat-progress-bar mode="indeterminate" aria-label="Cargando entrenamientos"></mat-progress-bar>
|
|
} @else if (!jobsError()) {
|
|
<p class="train__muted">Todavía no hay entrenamientos de TEA.</p>
|
|
}
|
|
|
|
@if (versionsLoaded()) {
|
|
<h3 class="train__title">Versiones eeg-* producidas</h3>
|
|
@if (versionsLoading()) {
|
|
<mat-progress-bar mode="indeterminate" aria-label="Cargando versiones"></mat-progress-bar>
|
|
}
|
|
@if (versionsError(); as error) {
|
|
<p class="train__alert" role="alert"><mat-icon aria-hidden="true">error</mat-icon>{{ error }}</p>
|
|
}
|
|
@if (!versionsLoading() && !versionsError()) {
|
|
@if (versions().length) {
|
|
<table mat-table [dataSource]="versions()" class="train__table" aria-label="Versiones eeg">
|
|
<ng-container matColumnDef="version">
|
|
<th mat-header-cell *matHeaderCellDef>Versión</th>
|
|
<td mat-cell *matCellDef="let v">{{ v.name }}:{{ v.version }}</td>
|
|
</ng-container>
|
|
<ng-container matColumnDef="status">
|
|
<th mat-header-cell *matHeaderCellDef>Estado</th>
|
|
<td mat-cell *matCellDef="let v"><app-model-status [status]="v.status"></app-model-status></td>
|
|
</ng-container>
|
|
<ng-container matColumnDef="created">
|
|
<th mat-header-cell *matHeaderCellDef>Creada</th>
|
|
<td mat-cell *matCellDef="let v">{{ v.created_at | date: 'medium' }}</td>
|
|
</ng-container>
|
|
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
|
|
<tr mat-row *matRowDef="let row; columns: displayedColumns"></tr>
|
|
</table>
|
|
} @else {
|
|
<p class="train__muted">El entrenamiento no produjo versiones eeg-*.</p>
|
|
}
|
|
}
|
|
}
|
|
</section>
|