.
This commit is contained in:
14
predict.sh
14
predict.sh
@@ -1,15 +1,15 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Arguments: script_dir working_dir tja_path difficulty
|
||||
SCRIPT_DIR=${1:-"script"}
|
||||
WORKING_DIR=${2:-"."}
|
||||
TJA_PATH=${3}
|
||||
DIFFICULTY=${4:-"oni"}
|
||||
# Arguments: working_dir tja_path difficulty
|
||||
WORKING_DIR=${1:-"."}
|
||||
TJA_PATH=${2}
|
||||
DIFFICULTY=${3:-"oni"}
|
||||
|
||||
if [ -z "$TJA_PATH" ]; then
|
||||
echo "Usage: ./redict.sh <script_dir> <working_dir> <tja_path> [difficulty: oni|edit]"
|
||||
echo "Usage: ./predict.sh <working_dir> <tja_path> [difficulty: oni|edit]"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Running prediction for $TJA_PATH..."
|
||||
bun "$SCRIPT_DIR/predict.ts" "$WORKING_DIR" "$SCRIPT_DIR" "$TJA_PATH" "$DIFFICULTY"
|
||||
# script_dir 인자가 사라졌으므로, 예측 스크립트 실행 시 인자 순서에 맞춰 실행
|
||||
bun script/predict.ts "$WORKING_DIR" "$TJA_PATH" "$DIFFICULTY"
|
||||
|
||||
@@ -1,16 +1,23 @@
|
||||
import { parseTja } from './parse';
|
||||
import { factorize } from './factorize';
|
||||
import { readdirSync, readFileSync, writeFileSync, existsSync } from 'fs';
|
||||
import { join } from 'path';
|
||||
import { readdirSync, readFileSync, writeFileSync, existsSync, mkdirSync } from 'fs';
|
||||
import { join, dirname } from 'path';
|
||||
import iconv from 'iconv-lite';
|
||||
|
||||
const [,, workingDir, dataDir] = process.argv;
|
||||
|
||||
if (existsSync(join(workingDir, 'features.json'))) {
|
||||
console.log('features.json already exists. Skipping extraction.');
|
||||
const featurePath = join(workingDir, 'factors.json');
|
||||
|
||||
if (existsSync(featurePath)) {
|
||||
console.log('factors.json already exists. Skipping extraction.');
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
// 작업 디렉토리 존재 확인 및 생성
|
||||
if (!existsSync(workingDir)) {
|
||||
mkdirSync(workingDir, { recursive: true });
|
||||
}
|
||||
|
||||
const tjaDir = join(dataDir, 'tja');
|
||||
const results: any[] = [];
|
||||
|
||||
@@ -38,5 +45,5 @@ for (const file of readdirSync(tjaDir)) {
|
||||
results.push({ songno, diff: diff === 'oni' ? 'oni' : 'ura', ...factors });
|
||||
}
|
||||
}
|
||||
writeFileSync(join(workingDir, 'features.json'), JSON.stringify(results, null, 2));
|
||||
console.log(`Features extracted to ${workingDir}/features.json`);
|
||||
writeFileSync(featurePath, JSON.stringify(results, null, 2));
|
||||
console.log(`Features extracted to ${featurePath}`);
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
{
|
||||
"physical_density": 1,
|
||||
"stamina_requirement": 1,
|
||||
"pattern_complexity": 1,
|
||||
"rhythmic_complexity": 1,
|
||||
"reading_gimmick": 1
|
||||
}
|
||||
@@ -1,86 +1,55 @@
|
||||
import { Bar, Course } from 'tja-parser';
|
||||
|
||||
export interface Factors {
|
||||
physical_density: number;
|
||||
stamina_requirement: number;
|
||||
pattern_complexity: number;
|
||||
rhythmic_complexity: number;
|
||||
reading_gimmick: number;
|
||||
}
|
||||
import { Course, Bar } from 'tja-parser';
|
||||
|
||||
export namespace Factor {
|
||||
export function getAllNotes(course: Course): any[] {
|
||||
const notes: any[] = [];
|
||||
// 노트 추출 및 정렬 (시간순)
|
||||
export function getAllNotes(course: Course) {
|
||||
const notes: { type: number, time: number }[] = [];
|
||||
for (const group of course.noteGroups) {
|
||||
if (group instanceof Bar) {
|
||||
notes.push(...group.getNotes());
|
||||
// 파서 구조에 따라 노트 추출 방식 조정 필요
|
||||
notes.push(...group.getNotes().map((note) => {
|
||||
return {
|
||||
//@ts-expect-error
|
||||
type: note.type,
|
||||
time: note.getTimingMS()
|
||||
}
|
||||
}));
|
||||
}
|
||||
}
|
||||
return notes;
|
||||
return notes.sort((a, b) => a.time - b.time).filter(n => [1, 2, 3, 4].includes(n.type));
|
||||
}
|
||||
|
||||
export function getPhysicalDensity(course: Course): number {
|
||||
const notes = getAllNotes(course);
|
||||
export function getAverageDensity(notes: { time: number }[]): number {
|
||||
if (notes.length < 2) return 0;
|
||||
const duration = (notes[notes.length - 1].time - notes[0].time) / 1000;
|
||||
return duration > 0 ? notes.length / duration : 0;
|
||||
}
|
||||
|
||||
export function getPeakDensity(notes: { time: number }[]): number {
|
||||
if (notes.length === 0) return 0;
|
||||
const bars = course.noteGroups.length;
|
||||
return notes.length / (bars || 1);
|
||||
}
|
||||
|
||||
export function getStaminaRequirement(course: Course): number {
|
||||
const notes = getAllNotes(course);
|
||||
let maxStream = 0;
|
||||
let currentStream = 0;
|
||||
|
||||
for (const note of notes) {
|
||||
if (note.type !== '0') {
|
||||
currentStream++;
|
||||
} else {
|
||||
maxStream = Math.max(maxStream, currentStream);
|
||||
currentStream = 0;
|
||||
let maxPeak = 0;
|
||||
const windowSize = 1000;
|
||||
for (let i = 0; i < notes.length; i++) {
|
||||
let count = 0;
|
||||
const startTime = notes[i].time;
|
||||
for (let j = i; j < notes.length && notes[j].time < startTime + windowSize; j++) {
|
||||
count++;
|
||||
}
|
||||
maxPeak = Math.max(maxPeak, count);
|
||||
}
|
||||
return Math.max(maxStream, currentStream) / 100;
|
||||
return maxPeak;
|
||||
}
|
||||
|
||||
export function getPatternComplexity(course: Course): number {
|
||||
const notes = getAllNotes(course).filter(n => n.type === '1' || n.type === '2');
|
||||
let transitions = 0;
|
||||
|
||||
for (let i = 1; i < notes.length; i++) {
|
||||
if (notes[i].type !== notes[i-1].type) {
|
||||
transitions++;
|
||||
}
|
||||
}
|
||||
return notes.length > 0 ? transitions / notes.length : 0;
|
||||
}
|
||||
|
||||
export function getRhythmicComplexity(course: Course): number {
|
||||
let complexNotes = 0;
|
||||
const allNotes = getAllNotes(course);
|
||||
for (const group of course.noteGroups) {
|
||||
if (group instanceof Bar) {
|
||||
const division = group.getNotes().length;
|
||||
if (division % 4 !== 0 || division > 16) {
|
||||
complexNotes += division;
|
||||
}
|
||||
}
|
||||
}
|
||||
return allNotes.length > 0 ? complexNotes / allNotes.length : 0;
|
||||
}
|
||||
|
||||
export function getReadingGimmick(course: Course): number {
|
||||
// BPM 변화나 Scroll 변화 빈도 측정
|
||||
// tja-parser의 구조에 따라 구현 (여기서는 placeholder)
|
||||
return 0;
|
||||
export function getMaxCombo(notes: any[]): number {
|
||||
return notes.length;
|
||||
}
|
||||
}
|
||||
|
||||
export function factorize(course: Course): Factors {
|
||||
export function factorize(course: Course) {
|
||||
const notes = Factor.getAllNotes(course);
|
||||
return {
|
||||
physical_density: Factor.getPhysicalDensity(course),
|
||||
stamina_requirement: Factor.getStaminaRequirement(course),
|
||||
pattern_complexity: Factor.getPatternComplexity(course),
|
||||
rhythmic_complexity: Factor.getRhythmicComplexity(course),
|
||||
reading_gimmick: Factor.getReadingGimmick(course)
|
||||
average_density: Factor.getAverageDensity(notes),
|
||||
peak_density: Factor.getPeakDensity(notes),
|
||||
max_combo: Factor.getMaxCombo(notes)
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -1,38 +1,97 @@
|
||||
import { parseTja } from './parse';
|
||||
import { factorize, Factors } from './factorize';
|
||||
import { factorize } from './factorize';
|
||||
import { join } from 'path';
|
||||
import { readFileSync } from 'fs';
|
||||
import { readFileSync, writeFileSync, unlinkSync, existsSync } from 'fs';
|
||||
import { execSync } from 'child_process';
|
||||
|
||||
async function predict() {
|
||||
const args = process.argv.slice(2);
|
||||
const workingDir = args[0];
|
||||
const scriptDir = args[1];
|
||||
const tjaPath = args[2];
|
||||
const difficulty = (args[3] || 'oni').toLowerCase() as 'oni' | 'edit';
|
||||
/**
|
||||
* 예측 엔진: 모델 실행을 위해 Python 환경을 호출
|
||||
*/
|
||||
function runInference(workingDir: string, factors: Record<string, number>): number {
|
||||
const tempFactorPath = join(workingDir, `temp_feat_${Date.now()}.json`);
|
||||
writeFileSync(tempFactorPath, JSON.stringify(factors));
|
||||
|
||||
if (!tjaPath) {
|
||||
console.error('Usage: bun script/predict.ts <working_dir> <script_dir> <tja_path> <difficulty>');
|
||||
const pythonScript = `
|
||||
import json, torch, sys
|
||||
import numpy as np
|
||||
import torch.nn as nn
|
||||
|
||||
# 모델 정의 (학습된 구조와 동일해야 함)
|
||||
class DifficultyNet(nn.Module):
|
||||
def __init__(self, input_dim):
|
||||
super().__init__()
|
||||
self.net = nn.Sequential(
|
||||
nn.Linear(input_dim, 128),
|
||||
nn.BatchNorm1d(128),
|
||||
nn.ReLU(),
|
||||
nn.Dropout(0.4),
|
||||
nn.Linear(128, 64),
|
||||
nn.ReLU(),
|
||||
nn.Dropout(0.3),
|
||||
nn.Linear(64, 32),
|
||||
nn.ReLU(),
|
||||
nn.Linear(32, 1),
|
||||
nn.Sigmoid()
|
||||
)
|
||||
def forward(self, x): return self.net(x)
|
||||
|
||||
def predict():
|
||||
try:
|
||||
with open('${tempFactorPath}', 'r') as f: factors = json.load(f)
|
||||
with open('${join(workingDir, 'scaler.json')}', 'r') as f: s = json.load(f)
|
||||
|
||||
X = np.array([[factors[col] for col in s['cols']]], dtype=np.float32)
|
||||
|
||||
# 정규화 (Robust/Standard 지원)
|
||||
if 'center' in s: X_scaled = (X - np.array(s['center'])) / np.array(s['scale'])
|
||||
else: X_scaled = (X - np.array(s.get('mean', 0))) / np.array(s.get('std', s.get('scale', 1)))
|
||||
|
||||
model = DifficultyNet(len(s['cols']))
|
||||
model.load_state_dict(torch.load('${join(workingDir, 'model.pth')}', map_location='cpu'))
|
||||
model.eval()
|
||||
|
||||
with torch.no_grad():
|
||||
input_tensor = torch.from_numpy(X_scaled).float()
|
||||
pred = model(input_tensor) * 11 + 1
|
||||
print(float(pred.item()))
|
||||
except Exception as e:
|
||||
print(f"ERROR: {e}", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
if __name__ == "__main__": predict()
|
||||
`;
|
||||
|
||||
const tempPyPath = join(workingDir, `inference_${Date.now()}.py`);
|
||||
writeFileSync(tempPyPath, pythonScript);
|
||||
|
||||
try {
|
||||
const result = execSync(`python3 ${tempPyPath}`).toString().trim();
|
||||
return parseFloat(result);
|
||||
} finally {
|
||||
if (existsSync(tempFactorPath)) unlinkSync(tempFactorPath);
|
||||
if (existsSync(tempPyPath)) unlinkSync(tempPyPath);
|
||||
}
|
||||
}
|
||||
|
||||
function main() {
|
||||
const [workingDir, tjaPath, difficulty = 'oni'] = process.argv.slice(2);
|
||||
|
||||
if (!workingDir || !tjaPath) {
|
||||
console.log("Usage: bun run script/predict.ts <workingDir> <tjaPath> [difficulty]");
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const factorJsonPath = join(scriptDir, 'factor.json');
|
||||
const weights: Factors = JSON.parse(readFileSync(factorJsonPath, 'utf-8'));
|
||||
|
||||
const tjaContent = readFileSync(tjaPath, 'utf-8');
|
||||
const parsed = parseTja(tjaContent);
|
||||
const chart = parsed[difficulty.toLowerCase() as 'oni' | 'edit'];
|
||||
|
||||
if (!parsed || !parsed[difficulty]) {
|
||||
console.error(`Error: Could not find difficulty '${difficulty}' in TJA.`);
|
||||
if (!chart) {
|
||||
console.error(`Error: Difficulty '${difficulty}' not found.`);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const factors = factorize(parsed[difficulty]!);
|
||||
const prediction = Object.keys(factors).reduce((sum, key) =>
|
||||
sum + (factors[key as keyof Factors] * weights[key as keyof Factors]), 0);
|
||||
|
||||
console.log(`Prediction for ${tjaPath} (${difficulty}):`);
|
||||
console.log(`- Predicted Value: ${prediction.toFixed(4)}`);
|
||||
console.log('- Factors:', factors);
|
||||
const score = runInference(workingDir, factorize(chart));
|
||||
console.log(`\n🎯 Predicted Difficulty: ${score.toFixed(2)}`);
|
||||
}
|
||||
|
||||
predict();
|
||||
main();
|
||||
|
||||
193
script/train.py
193
script/train.py
@@ -1,67 +1,152 @@
|
||||
import pandas as pd
|
||||
import json, os, sys, joblib
|
||||
import json, os, sys
|
||||
import numpy as np
|
||||
from sklearn.ensemble import GradientBoostingRegressor
|
||||
from sklearn.model_selection import train_test_split
|
||||
import torch
|
||||
import torch.nn as nn
|
||||
import torch.optim as optim
|
||||
from sklearn.preprocessing import StandardScaler
|
||||
|
||||
def train(script_dir, working_dir, data_dir, train_count, val_count, margin):
|
||||
features = pd.read_json(os.path.join(working_dir, 'features.json'))
|
||||
measures = pd.read_csv(os.path.join(data_dir, 'measure.csv'))
|
||||
|
||||
features['songno'] = features['songno'].astype(int)
|
||||
measures['songno'] = measures['songno'].astype(int)
|
||||
measures['diff'] = measures['diff'].replace('ura', 'edit')
|
||||
|
||||
df = pd.merge(features, measures, on=['songno', 'diff'])
|
||||
|
||||
with open(os.path.join(script_dir, 'factor.json'), 'r') as f:
|
||||
weights = json.load(f)
|
||||
for col in ['physical_density', 'stamina_requirement', 'pattern_complexity', 'rhythmic_complexity', 'reading_gimmick']:
|
||||
df[col] = df[col] * weights.get(col, 1.0)
|
||||
MAX_MARGIN_LIMIT = 3
|
||||
|
||||
X_cols = ['physical_density', 'stamina_requirement', 'pattern_complexity', 'rhythmic_complexity', 'reading_gimmick']
|
||||
model_path = os.path.join(working_dir, 'model.pkl')
|
||||
model = joblib.load(model_path) if os.path.exists(model_path) else GradientBoostingRegressor(n_estimators=200, learning_rate=0.05, max_depth=3)
|
||||
class DifficultyNet(nn.Module):
|
||||
def __init__(self, input_dim):
|
||||
super(DifficultyNet, self).__init__()
|
||||
self.net = nn.Sequential(
|
||||
nn.Linear(input_dim, 128),
|
||||
nn.BatchNorm1d(128),
|
||||
nn.ReLU(),
|
||||
nn.Dropout(0.4),
|
||||
nn.Linear(128, 64),
|
||||
nn.ReLU(),
|
||||
nn.Dropout(0.3),
|
||||
nn.Linear(64, 32),
|
||||
nn.ReLU(),
|
||||
nn.Linear(32, 1),
|
||||
nn.Sigmoid()
|
||||
)
|
||||
|
||||
def forward(self, x):
|
||||
return self.net(x)
|
||||
|
||||
def train(script_dir, working_dir, data_dir, train_count, val_count, margin, val_iterations):
|
||||
device = torch.device("mps" if torch.backends.mps.is_available() else "cpu")
|
||||
print(f"🚀 Using Device: {device}")
|
||||
|
||||
# 데이터 로드 및 병합
|
||||
factors_path = os.path.join(working_dir, 'factors.json')
|
||||
if not os.path.exists(factors_path):
|
||||
os.system(f"bun run {os.path.join(script_dir, 'factorize.ts')} {data_dir} {working_dir}")
|
||||
|
||||
df_feat = pd.read_json(factors_path)
|
||||
df_meas = pd.read_csv(os.path.join(data_dir, 'measure.csv'))
|
||||
df_meas['diff'] = df_meas['diff'].replace('ura', 'edit')
|
||||
df_feat['songno'], df_meas['songno'] = df_feat['songno'].astype(int), df_meas['songno'].astype(int)
|
||||
df = pd.merge(df_feat, df_meas, on=['songno', 'diff'])
|
||||
|
||||
exclude_cols = ['songno', 'diff', 'title', 'course', '상수', 'predicted_measure', 'error']
|
||||
X_cols = [c for c in df_feat.columns if c not in exclude_cols]
|
||||
|
||||
scaler = StandardScaler()
|
||||
df[X_cols] = scaler.fit_transform(df[X_cols])
|
||||
with open(os.path.join(working_dir, 'scaler.json'), 'w') as f:
|
||||
json.dump({'mean': scaler.mean_.tolist(), 'std': scaler.scale_.tolist(), 'cols': X_cols}, f)
|
||||
|
||||
model_path = os.path.join(working_dir, 'model.pth')
|
||||
margin = float(margin)
|
||||
val_iterations = int(val_iterations)
|
||||
|
||||
model = DifficultyNet(len(X_cols)).to(device)
|
||||
attempt = 1
|
||||
|
||||
iteration = 1
|
||||
while True:
|
||||
# 3. 데이터 샘플링
|
||||
df_sample = df.sample(n=int(train_count) + int(val_count))
|
||||
train_df, val_df = train_test_split(df_sample, test_size=int(val_count))
|
||||
print(f"\n[Attempt {attempt}] " + "-"*40)
|
||||
if os.path.exists(model_path):
|
||||
try: model.load_state_dict(torch.load(model_path, map_location=device))
|
||||
except: pass
|
||||
|
||||
X_train, y_train = train_df[X_cols], train_df['상수']
|
||||
X_val, y_val = val_df[X_cols], val_df['상수']
|
||||
train_df = df.sample(n=min(int(train_count), len(df)))
|
||||
X_train = torch.FloatTensor(train_df[X_cols].values).to(device)
|
||||
y_train = torch.FloatTensor(((train_df['상수'].values - 1) / 11)).unsqueeze(1).to(device)
|
||||
|
||||
# 4. 학습 (최대 10회)
|
||||
for attempt in range(1, 11):
|
||||
model.fit(X_train, y_train)
|
||||
train_err = np.max(np.abs(np.clip(model.predict(X_train), 1.0, 12.0) - y_train))
|
||||
print(f"Iteration {iteration} - Attempt {attempt} - Train Error: {train_err:.4f}")
|
||||
if train_err <= float(margin): break
|
||||
model.set_params(n_estimators=model.n_estimators + 50)
|
||||
base_lr = 0.001
|
||||
optimizer = optim.Adam(model.parameters(), lr=base_lr, weight_decay=1e-5)
|
||||
criterion = nn.L1Loss()
|
||||
|
||||
# 5. 검증
|
||||
pred_val = np.clip(model.predict(X_val), 1.0, 12.0)
|
||||
val_errors = np.abs(pred_val - y_val)
|
||||
|
||||
# 6. 검증 실패 시 재시도
|
||||
if np.any(val_errors > float(margin)):
|
||||
print(f"Validation failed (max error: {np.max(val_errors):.4f}). Retrying...")
|
||||
iteration += 1
|
||||
continue
|
||||
model.train()
|
||||
epoch = 0
|
||||
while True:
|
||||
optimizer.zero_grad()
|
||||
preds_train = model(X_train)
|
||||
loss = criterion(preds_train, y_train) # MSELoss 권장
|
||||
loss.backward()
|
||||
optimizer.step()
|
||||
|
||||
val_result = pd.DataFrame({
|
||||
'songno': val_df['songno'],
|
||||
'difficulty': val_df['diff'],
|
||||
'measure': y_val,
|
||||
'predicted_measure': pred_val,
|
||||
'error': val_errors
|
||||
})
|
||||
val_result.to_csv(os.path.join(working_dir, f'validate_result_{iteration}.csv'), index=False)
|
||||
val_result.to_csv(os.path.join(working_dir, 'validate_result.csv'), index=False)
|
||||
break
|
||||
# 현재 학습 데이터에 대한 오차 분석
|
||||
with torch.no_grad():
|
||||
diff = torch.abs((preds_train * 11 + 1) - (y_train * 11 + 1))
|
||||
train_mae = torch.mean(diff).item()
|
||||
train_max = torch.max(diff).item()
|
||||
|
||||
if epoch % 1000 == 0:
|
||||
print(f" - Ep {epoch:5d} | MAE: {train_mae:.4f} | MAX: {train_max:.4f}")
|
||||
|
||||
# ✅ 조건 강화: MAE뿐만 아니라 MAX도 어느 정도 잡혔을 때만 검증으로 이동
|
||||
if train_mae < margin and train_max < (margin * MAX_MARGIN_LIMIT):
|
||||
print(f" ✅ Train Goal Reached (MAE: {train_mae} < {margin:.4f}, MAX: {train_max:.4f} < {(margin * MAX_MARGIN_LIMIT):.4f}). Moving to Val.")
|
||||
break
|
||||
|
||||
epoch += 1
|
||||
if epoch > 50000:
|
||||
print(" ⚠️ Timed out. Resampling...")
|
||||
break
|
||||
|
||||
if train_mae >= margin:
|
||||
torch.save(model.state_dict(), model_path)
|
||||
attempt += 1
|
||||
continue
|
||||
|
||||
joblib.dump(model, model_path)
|
||||
# 3. 검증 단계
|
||||
print(f"3. Validating {val_iterations} iterations...")
|
||||
model.eval()
|
||||
all_passed = True
|
||||
with torch.no_grad():
|
||||
for i in range(1, val_iterations + 1):
|
||||
val_df = df.sample(n=min(int(val_count), len(df)))
|
||||
X_val = torch.FloatTensor(val_df[X_cols].values).to(device)
|
||||
y_val_raw = val_df['상수'].values
|
||||
preds = model(X_val) * 11 + 1
|
||||
y_val_tensor = torch.FloatTensor(y_val_raw).unsqueeze(1).to(device)
|
||||
diff_tensor = torch.abs(preds - y_val_tensor)
|
||||
mae = torch.mean(diff_tensor).item()
|
||||
max_error = torch.max(diff_tensor).item()
|
||||
|
||||
|
||||
# csv 저장
|
||||
# preds를 CPU 넘파이로 변환하고 1차원으로 펴주는 과정이 포함되어야 합니다.
|
||||
preds_np = preds.detach().cpu().numpy().flatten() if torch.is_tensor(preds) else preds
|
||||
|
||||
res_df = val_df[['songno', 'diff', '상수']].copy()
|
||||
res_df['predicted_measure'] = preds_np
|
||||
res_df['error'] = np.abs(preds_np - y_val_raw)
|
||||
|
||||
output_file = os.path.join(working_dir, f'validate_result_{i}.csv')
|
||||
res_df.to_csv(output_file, index=False)
|
||||
|
||||
if mae <= margin and max_error <= (margin * MAX_MARGIN_LIMIT):
|
||||
print(f" [Iter {i}] ✅ PASS (MAE: {mae:.4f}, MAX: {max_error:.4f})")
|
||||
else:
|
||||
print(f" [Iter {i}] ❌ FAIL (MAE: {mae:.4f} > {margin}, MAX: {max_error:.4f} > {margin * MAX_MARGIN_LIMIT})")
|
||||
all_passed = False
|
||||
break
|
||||
|
||||
if all_passed:
|
||||
print(f"\n✨ Final Success!")
|
||||
torch.save(model.state_dict(), model_path)
|
||||
return
|
||||
else:
|
||||
torch.save(model.state_dict(), model_path)
|
||||
attempt += 1
|
||||
|
||||
if __name__ == "__main__":
|
||||
train(sys.argv[1], sys.argv[2], sys.argv[3], sys.argv[4], sys.argv[5], sys.argv[6])
|
||||
if len(sys.argv) < 8: sys.exit(1)
|
||||
train(*sys.argv[1:8])
|
||||
@@ -30,10 +30,12 @@ async function train() {
|
||||
|
||||
console.log(`Training with ${trainFiles.length} files...`);
|
||||
|
||||
// 학습 로직 (단순화된 경사 하강법 또는 반복 최적화)
|
||||
// 학습 로직 (Sigmoid + [1, 12] scaling)
|
||||
const sigmoid = (x: number) => 1 / (1 + Math.exp(-x));
|
||||
|
||||
let error = Infinity;
|
||||
let iterations = 0;
|
||||
while (error > margin && iterations < 100) {
|
||||
while (error > margin && iterations < 10) { // Spec에 따라 10번 반복
|
||||
let totalError = 0;
|
||||
let count = 0;
|
||||
|
||||
@@ -48,24 +50,32 @@ async function train() {
|
||||
if (!course) continue;
|
||||
|
||||
const target = records.find((r: any) => r.songno === songno && (r.diff === (diff === 'oni' ? 'oni' : 'ura')));
|
||||
if (!target) {
|
||||
// console.log(`[!] No target for ${songno} diff=${diff}`);
|
||||
continue;
|
||||
}
|
||||
if (!target) continue;
|
||||
|
||||
const factors = factorize(course);
|
||||
const prediction = Object.keys(factors).reduce((sum, key) =>
|
||||
sum + (factors[key as keyof Factors] * weights[key as keyof Factors]), 0);
|
||||
// 가중치 적용 전 정규화 (임의 값으로 가정)
|
||||
const normalizedFactors = {
|
||||
physical_density: Math.min(factors.physical_density / 20, 1),
|
||||
stamina_requirement: Math.min(factors.stamina_requirement, 1),
|
||||
pattern_complexity: Math.min(factors.pattern_complexity, 1),
|
||||
rhythmic_complexity: Math.min(factors.rhythmic_complexity, 1),
|
||||
reading_gimmick: Math.min(factors.reading_gimmick, 1)
|
||||
};
|
||||
|
||||
const rawPrediction = Object.keys(normalizedFactors).reduce((sum, key) =>
|
||||
sum + (normalizedFactors[key as keyof Factors] * weights[key as keyof Factors]), 0);
|
||||
|
||||
const prediction = (sigmoid(rawPrediction) * 11) + 1; // [1, 12]
|
||||
|
||||
const targetValue = parseFloat(target.상수);
|
||||
const diff_val = targetValue - prediction;
|
||||
totalError += Math.abs(diff_val);
|
||||
count++;
|
||||
|
||||
// 가중치 업데이트
|
||||
// 가중치 업데이트 (간단한 경사 하강법)
|
||||
for (const key in weights) {
|
||||
const k = key as keyof Factors;
|
||||
weights[k] += diff_val * factors[k] * 0.05; // 학습률 조정
|
||||
weights[k] += diff_val * normalizedFactors[k] * 0.01;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
80
spec.md
80
spec.md
@@ -7,69 +7,47 @@
|
||||
- data_dir
|
||||
- train_data_count = 100
|
||||
- validate_data_count = 20
|
||||
- margin = 0.1
|
||||
- margin = 0.5
|
||||
- validate_iterations = 5
|
||||
|
||||
## 학습 모델
|
||||
- **추천:** PyTorch 기반의 **Deep MLP** (Dropout 및 Weight Decay 필수 적용)
|
||||
- **과적합 방지 전략:**
|
||||
- **Dropout (0.3 ~ 0.5):** 학습 시 뉴런을 의도적으로 꺼서 특정 데이터 암기를 방지한다.
|
||||
- **L2 Regularization (Weight Decay):** 가중치가 비정상적으로 커지는 것을 막는다.
|
||||
- **Output Mapping:** 최종 출력에 `Sigmoid`를 걸고 (y * 11) + 1을 적용해 [1, 12] 범위를 강제한다.
|
||||
|
||||
## 학습 과정
|
||||
1. `{data_dir}/tja`의 tja를 파싱한다.
|
||||
- `{script_dir}/parse.ts`를 사용한다.
|
||||
2. `oni`와 `edit` course를 factorize한다.
|
||||
- `{script_dir}/factorize.ts`를 사용하며, `{working_dir}/features.json`에 저장한다. 이 때, songno와 난이도(oni | edit)을 같이 저장하여야한다.
|
||||
- `{working_dir}/features.json`이 이미 존재하면 이 과정은 생략한다.
|
||||
3. factorized된 데이터를 `train_data_count` 만큼 랜덤으로 가져온다.
|
||||
4. train data로 학습을 진행한다.
|
||||
- 예측 값이 [1, 12]에 없으면 완전히 잘못 트레이닝 된 것이다.
|
||||
- `{data_dir}/measure.csv`로 오차 확인
|
||||
- course가 `edit`이면 measure.json에서는 `ura`이므로 적절히 매칭한다.
|
||||
- Train error를 계속 로깅한다.
|
||||
- Train error가 `margin`보다 클 경우 이 과정(4번)을 다시 진행한다.
|
||||
- 최대 10번만 진행한다.
|
||||
5. validate_data_count 만큼 랜덤으로 validate data를 가져온 후 validate data로 각각의 measure, 예측한 measure, 오차를 `validate_result_{n}.csv`로 저장한다.
|
||||
- `validate_result_{n}.csv`에는 `songno`, `difficulty`, `measure`, `predicted_measure`, `error`을 작성한다. (중요)
|
||||
- `n`에는 몇번째 iteration인지 적는다.
|
||||
6. 만약 validate한 데이터 중 오차가 `margin`보다 큰 것이 있다면 3~5과정을 다시 반복한다.
|
||||
7. 모델 파일을 저장한다.
|
||||
1. `{data_dir}/tja`의 tja를 파싱한다. (`{script_dir}/parse.ts`)
|
||||
2. `oni`와 `edit` course를 factorize하여 `{working_dir}/factors.json`에 저장한다.
|
||||
- 이미 존재하면 생략하되, Factor 로직 수정 시 삭제 후 재실행한다.
|
||||
3. 데이터 표준화(Standardization)를 위한 스케일링 파라미터를 계산하고 `{working_dir}/scaler.json`에 저장한다.
|
||||
4. **학습 단계:** 전체 데이터 중 `train_data_count`만큼 데이터를 랜덤하게 추출하여 학습을 진행한다.
|
||||
- `edit` 코스는 `ura`와 매칭하여 오차를 계산한다.
|
||||
- 모델이 충분히 수렴할 때까지 학습을 수행하며, 기존 모델 존재 시 가중치를 로드하여 업데이트한다.
|
||||
5. **검증 단계:** 학습이 완료된 모델을 대상으로 아래 과정을 수행한다.
|
||||
- `validate_data_count`만큼의 데이터를 랜덤하게 추출하여 오차를 계산하고 `validate_result_{n}.csv`에 저장한다.
|
||||
- 이 과정을 `validate_iterations` 횟수만큼 반복한다.
|
||||
- **재시도 조건:** 검증 루프 도중 단 한 번이라도 Mean Absolute Error(MAE)가 `margin`보다 크다면, 즉시 검증을 중단하고 4번(학습 단계)으로 돌아가 데이터를 새로 샘플링하여 재학습한다.
|
||||
6. **성공 및 종료:** 모든 `validate_iterations` 회차에서 MAE가 `margin` 이하일 경우에만 학습 성공으로 간주하고 최종 모델 파일을 저장한다.
|
||||
|
||||
### 유의 사항
|
||||
- 모든 출력되는 데이터는 working_dir에 저장한다.
|
||||
- 이미 working_dir에 모델이 존재하면 모델을 삭제하지 않고 업데이트하는 식으로 학습한다.
|
||||
- 애플 실리콘 cpu를 사용할 경우 적극적으로 gpu를 사용할 수 있도록 한다.
|
||||
- 모든 데이터는 `working_dir`에 저장한다.
|
||||
- Apple Silicon 환경에서 `mps` 디바이스를 할당하여 GPU 가속을 사용한다.
|
||||
|
||||
# 예측
|
||||
## CLi
|
||||
- cli로 예측 데이터를 뽑을 수 있는 쉘 스크립트를 작성한다.
|
||||
- argument
|
||||
- working_dir
|
||||
- tja
|
||||
- difficulty: oni | edit
|
||||
## CLI
|
||||
- argument: `working_dir`, `tja`, `difficulty` (oni | edit)
|
||||
|
||||
## 예측 과정
|
||||
- `working_dir`에 있는 model로 예측을 진행한다.
|
||||
- `tja` argument에 tja파일이 존재한다.
|
||||
- `difficulty`로 예측을 진행할 난이도를 선택한다.
|
||||
- 로드된 모델과 학습 시 사용했던 스케일링 파라미터(Mean, Std)를 동일하게 적용하여 예측을 진행한다.
|
||||
|
||||
# Factor
|
||||
## 종류
|
||||
- physical_density: 곡의 전반적인 및 순간적인 타격 밀도 (Global NPS, Peak NPS)
|
||||
- stamina_requirement: 긴 연타 구간과 휴식 구간의 비율을 통한 체력 소모량
|
||||
- pattern_complexity: 색상 전환 및 손 배치 전환(Hand-switching)의 복잡도
|
||||
- rhythmic_complexity: 엇박, 다양한 음표 단위 사용 등으로 인한 리듬의 난해함
|
||||
- reading_gimmick: BPM 변화, 스크롤 속도(SV) 변동 등 시각적 요소 및 기믹
|
||||
|
||||
## 가중치 (하이퍼 파라미터)
|
||||
`script/factor.json`에 `Record<factor 이름, 가중치>`를 기록한다.
|
||||
- average_density: 평균 밀도
|
||||
- peak_density: 최고 초당 밀도
|
||||
- max_combo: 노트의 수
|
||||
|
||||
# Scripts
|
||||
## `script/parse.ts`
|
||||
- `parseTja` 함수
|
||||
- tja를 string으로 받는다.
|
||||
- `Partial<Record<'oni' | 'edit', Course>> | null`을 반환한다.
|
||||
- null이 반환되면 에러가 나온 것이므로 무시한다.
|
||||
## `script/factorize.ts`
|
||||
- `factorize` 함수
|
||||
- course를 input으로 받는다.
|
||||
- factor들을 반환한다.
|
||||
- `Factor` namespace
|
||||
- 각 factor을 반환하는 함수의 namespace이다.
|
||||
- `factorize` 함수는 `Factor` namespace에서 함수들을 호출하여 factor들을 반환한다.
|
||||
- `parse.ts`: TJA 문자열을 `Course` 객체로 변환.
|
||||
- `factorize.ts`: `Course`를 입력받아 확장된 `Factor` 세트를 반환.
|
||||
10264
test/factors.json
Normal file
10264
test/factors.json
Normal file
File diff suppressed because it is too large
Load Diff
BIN
test/model.pth
Normal file
BIN
test/model.pth
Normal file
Binary file not shown.
1
test/scaler.json
Normal file
1
test/scaler.json
Normal file
@@ -0,0 +1 @@
|
||||
{"mean": [5.390975807838123, 11.135695764909247, 630.3327571305099], "std": [1.4301422132137462, 3.0709973724562003, 211.64659003608378], "cols": ["average_density", "peak_density", "max_combo"]}
|
||||
1
test/temp_factors.json
Normal file
1
test/temp_factors.json
Normal file
@@ -0,0 +1 @@
|
||||
{"average_density":6.492187500000001,"peak_density":14,"max_combo":831}
|
||||
201
test/validate_result_1.csv
Normal file
201
test/validate_result_1.csv
Normal file
@@ -0,0 +1,201 @@
|
||||
songno,diff,상수,predicted_measure,error
|
||||
247,oni,5.5,5.2725,0.22749996185302734
|
||||
246,oni,1.1,3.596659,2.496658945083618
|
||||
1199,oni,4.3,2.9755948,1.324405241012573
|
||||
860,oni,10.6,9.705553,0.8944469451904293
|
||||
39,oni,5.6,6.1024475,0.5024475097656254
|
||||
1279,oni,8.4,8.08667,0.31333007812500036
|
||||
1178,oni,3.5,3.5068276,0.006827592849731445
|
||||
1155,oni,4.3,3.6213677,0.6786323070526121
|
||||
63,oni,6.1,5.844149,0.25585088729858363
|
||||
641,oni,8.4,7.899804,0.5001958847045902
|
||||
647,oni,7.8,7.7702703,0.02972965240478498
|
||||
1026,oni,4.1,4.470079,0.37007894515991246
|
||||
488,oni,5.7,5.910693,0.21069316864013654
|
||||
773,oni,4.0,4.5387897,0.5387897491455078
|
||||
1201,oni,1.9,3.921908,2.021907901763916
|
||||
177,oni,2.0,2.8112068,0.8112068176269531
|
||||
1039,oni,9.2,9.261316,0.06131629943847727
|
||||
108,oni,6.8,7.2224617,0.4224617004394533
|
||||
1059,oni,5.6,4.5673223,1.0326777458190914
|
||||
1125,oni,3.6,3.8051248,0.20512475967407218
|
||||
345,oni,4.5,4.752472,0.252471923828125
|
||||
1186,oni,1.9,2.9006872,1.0006872177124024
|
||||
1179,oni,5.0,5.2376785,0.23767852783203125
|
||||
1411,oni,9.1,8.738385,0.36161479949951136
|
||||
1145,oni,7.2,6.407096,0.7929040908813478
|
||||
417,oni,3.3,3.5370734,0.23707337379455584
|
||||
74,oni,4.5,5.398354,0.8983540534973145
|
||||
544,oni,5.9,6.0266037,0.1266036987304684
|
||||
935,oni,9.5,9.191151,0.3088493347167969
|
||||
110,oni,10.9,7.6176825,3.2823175430297855
|
||||
1319,oni,8.8,8.815666,0.01566619873046804
|
||||
1228,oni,4.1,4.2427197,0.14271965026855504
|
||||
615,oni,9.0,8.767521,0.23247909545898438
|
||||
1146,oni,7.5,7.4651394,0.03486061096191406
|
||||
405,oni,3.1,5.056039,1.9560388565063476
|
||||
8,oni,2.2,3.7271776,1.5271776199340819
|
||||
285,oni,4.3,4.8761697,0.5761696815490724
|
||||
1286,oni,2.2,3.0876362,0.8876362323760985
|
||||
259,oni,6.6,6.396202,0.2037979125976559
|
||||
1274,oni,4.8,6.104219,1.3042189598083498
|
||||
886,oni,1.9,3.2270806,1.3270805835723878
|
||||
1118,oni,1.2,2.8580723,1.658072280883789
|
||||
1176,oni,4.0,3.527431,0.47256898880004883
|
||||
42,oni,1.1,3.3398852,2.2398852348327636
|
||||
799,oni,5.7,4.7683806,0.9316193580627443
|
||||
967,oni,8.8,7.698433,1.1015670776367195
|
||||
539,oni,6.0,6.0380173,0.03801727294921875
|
||||
445,oni,7.1,6.515002,0.5849982261657711
|
||||
482,oni,1.8,3.32895,1.5289499282836914
|
||||
1355,oni,9.0,7.8457313,1.154268741607666
|
||||
22,oni,5.5,6.1377096,0.6377096176147461
|
||||
113,oni,5.7,5.555111,0.1448890686035158
|
||||
739,oni,7.1,7.8227615,0.7227615356445316
|
||||
794,oni,7.6,7.0705323,0.529467678070068
|
||||
355,oni,10.0,8.396488,1.6035118103027344
|
||||
455,oni,5.7,5.748408,0.04840784072875959
|
||||
775,oni,10.6,9.172316,1.42768440246582
|
||||
1418,oni,8.0,7.8505096,0.1494903564453125
|
||||
478,oni,5.8,4.8743525,0.9256475448608397
|
||||
236,oni,2.2,4.2807217,2.0807216644287108
|
||||
1311,oni,6.7,7.5999484,0.8999484062194822
|
||||
790,oni,2.5,3.3790677,0.8790676593780518
|
||||
88,oni,8.1,7.4207373,0.6792627334594723
|
||||
660,oni,6.6,6.459454,0.14054594039916957
|
||||
939,oni,7.4,7.2584605,0.1415394783020023
|
||||
1100,oni,3.9,4.6481123,0.7481122970581056
|
||||
1001,oni,3.6,3.5810204,0.018979644775390714
|
||||
248,oni,6.2,6.3501973,0.15019731521606428
|
||||
341,oni,3.3,4.576923,1.27692289352417
|
||||
644,oni,4.4,4.404581,0.004581069946288707
|
||||
472,oni,5.9,6.3437867,0.4437867164611813
|
||||
792,oni,3.7,3.8640676,0.16406755447387678
|
||||
428,oni,6.5,6.3807287,0.11927127838134766
|
||||
754,oni,5.0,5.1724863,0.1724863052368164
|
||||
1133,oni,5.7,6.4210324,0.7210324287414549
|
||||
1235,oni,7.8,7.6141486,0.18585138320922834
|
||||
1317,oni,11.2,10.63248,0.5675203323364251
|
||||
1106,oni,9.1,8.950381,0.14961872100830043
|
||||
601,oni,3.5,4.1207476,0.6207475662231445
|
||||
1432,oni,10.0,8.503614,1.4963855743408203
|
||||
1207,oni,7.8,7.735499,0.06450109481811506
|
||||
1208,oni,4.3,5.267852,0.9678518295288088
|
||||
578,oni,6.5,5.0540576,1.4459424018859863
|
||||
1031,oni,4.7,4.8403573,0.1403573036193846
|
||||
491,oni,8.2,8.015301,0.18469924926757741
|
||||
843,oni,10.0,9.856177,0.14382266998291016
|
||||
1261,oni,7.3,7.2535615,0.04643850326538068
|
||||
816,oni,8.2,8.119859,0.08014125823974538
|
||||
1337,oni,3.9,4.6578474,0.7578474044799806
|
||||
1072,oni,9.8,7.600742,2.1992581367492683
|
||||
37,oni,5.3,5.2767086,0.023291397094726385
|
||||
556,oni,4.4,4.318159,0.08184089660644567
|
||||
596,oni,6.8,6.5767,0.22329978942871076
|
||||
933,oni,7.1,7.283629,0.18362894058227575
|
||||
270,oni,6.9,6.4714212,0.42857875823974645
|
||||
911,oni,4.7,4.7063766,0.006376552581786932
|
||||
160,oni,5.3,5.3374934,0.037493419647216975
|
||||
399,oni,7.6,7.693502,0.09350194931030309
|
||||
1080,oni,8.0,7.970645,0.02935504913330078
|
||||
746,oni,8.0,8.314695,0.3146953582763672
|
||||
427,oni,9.1,8.443438,0.6565624237060543
|
||||
1296,oni,7.9,8.019875,0.1198745727539059
|
||||
380,oni,4.6,4.371937,0.22806320190429652
|
||||
1004,oni,5.9,5.448553,0.4514469146728519
|
||||
266,oni,6.3,8.509695,2.209695053100586
|
||||
624,oni,5.6,5.243518,0.3564821243286129
|
||||
750,oni,8.8,8.119534,0.6804664611816413
|
||||
1105,oni,5.5,4.0916586,1.408341407775879
|
||||
1362,oni,6.1,5.757848,0.3421522140502926
|
||||
1202,oni,4.8,4.697151,0.10284881591796857
|
||||
396,oni,5.8,6.155394,0.35539407730102557
|
||||
219,oni,5.1,4.664316,0.4356838226318356
|
||||
124,oni,5.5,5.801539,0.30153894424438477
|
||||
32,oni,6.8,6.472562,0.32743816375732404
|
||||
33,oni,10.5,8.676422,1.823577880859375
|
||||
819,oni,8.6,7.86986,0.7301398277282711
|
||||
506,oni,5.6,3.7444363,1.8555637359619137
|
||||
364,oni,5.2,5.2186875,0.018687534332275213
|
||||
218,oni,7.7,7.626425,0.07357521057128924
|
||||
55,oni,8.7,7.312134,1.3878662109374993
|
||||
1225,oni,5.3,4.8498535,0.4501464843749998
|
||||
150,oni,6.3,5.750553,0.5494468688964842
|
||||
689,oni,4.3,4.3800893,0.08008928298950213
|
||||
1356,oni,9.4,8.77751,0.6224903106689457
|
||||
339,oni,6.8,3.677099,3.1229010105133055
|
||||
571,oni,9.1,7.775726,1.3242741584777828
|
||||
1336,oni,2.9,3.8107193,0.9107192516326905
|
||||
360,oni,9.2,8.764785,0.4352151870727532
|
||||
762,oni,10.3,10.230464,0.06953601837158274
|
||||
1095,oni,6.2,4.828952,1.371048164367676
|
||||
1422,oni,5.6,5.737846,0.1378458976745609
|
||||
1150,oni,4.1,4.486331,0.3863309860229496
|
||||
738,oni,7.9,7.607025,0.29297485351562536
|
||||
95,oni,7.3,7.3256226,0.025622558593750178
|
||||
1173,oni,9.2,8.770874,0.4291259765624993
|
||||
611,oni,3.8,3.7210314,0.07896857261657697
|
||||
415,oni,1.8,3.6390128,1.8390128135681152
|
||||
420,oni,4.3,4.0958514,0.20414857864379865
|
||||
1450,oni,2.9,3.2371683,0.337168312072754
|
||||
312,oni,1.1,2.8274343,1.7274343013763427
|
||||
193,oni,4.4,6.1280093,1.7280093193054196
|
||||
925,oni,5.2,3.687907,1.5120930194854738
|
||||
846,oni,8.5,8.5911455,0.09114551544189453
|
||||
549,oni,8.3,8.18619,0.1138103485107429
|
||||
103,oni,8.2,8.056568,0.14343185424804616
|
||||
517,oni,8.2,8.255187,0.055187034606934304
|
||||
627,oni,11.5,9.760542,1.7394580841064453
|
||||
60,oni,7.9,7.881064,0.018936061859131215
|
||||
948,oni,8.3,8.36591,0.06590957641601491
|
||||
1019,oni,5.5,5.212821,0.28717899322509766
|
||||
680,oni,7.9,7.9404883,0.04048833847045863
|
||||
142,oni,3.0,3.7907765,0.7907764911651611
|
||||
460,oni,2.7,2.6523027,0.047697257995605646
|
||||
315,oni,3.2,4.228785,1.0287850379943846
|
||||
1149,oni,3.8,6.2704215,2.4704215049743654
|
||||
887,oni,7.2,6.998309,0.20169086456298846
|
||||
1177,oni,3.4,4.0435953,0.643595314025879
|
||||
1018,oni,4.9,4.9320893,0.032089328765868785
|
||||
1252,oni,4.9,4.427538,0.47246208190918004
|
||||
1250,oni,6.0,6.7224565,0.7224564552307129
|
||||
1172,oni,11.9,10.33794,1.5620597839355472
|
||||
167,oni,7.1,8.270915,1.1709150314331058
|
||||
1074,oni,3.1,2.9782546,0.1217454433441163
|
||||
931,oni,7.7,6.1198707,1.5801293373107912
|
||||
1412,oni,6.2,6.288117,0.08811693191528303
|
||||
955,oni,10.5,8.674553,1.8254470825195312
|
||||
220,oni,9.3,8.375487,0.9245126724243171
|
||||
1153,oni,1.8,2.7926855,0.9926855087280273
|
||||
214,oni,7.8,7.8332896,0.033289623260498225
|
||||
1119,oni,5.2,4.9443893,0.2556106567382814
|
||||
824,oni,1.3,2.3053257,1.0053257465362548
|
||||
757,oni,10.5,9.727542,0.7724580764770508
|
||||
943,oni,9.6,8.187772,1.4122282028198239
|
||||
1403,oni,5.0,3.9427001,1.0572998523712158
|
||||
93,oni,5.9,5.960514,0.06051406860351527
|
||||
79,oni,3.2,4.004117,0.8041170120239256
|
||||
820,oni,10.7,9.254421,1.44557876586914
|
||||
756,oni,10.3,9.224383,1.075616645812989
|
||||
661,oni,2.9,3.5737593,0.6737593173980714
|
||||
621,oni,8.2,7.816741,0.3832590103149407
|
||||
414,oni,5.8,6.573568,0.7735678672790529
|
||||
1162,oni,3.9,4.0557995,0.15579948425292978
|
||||
127,oni,5.9,5.9219584,0.02195844650268519
|
||||
358,oni,7.5,6.487585,1.0124149322509766
|
||||
1163,oni,8.3,7.0331225,1.266877460479737
|
||||
676,oni,2.6,3.9374194,1.3374194145202636
|
||||
504,oni,6.1,6.345606,0.24560585021972692
|
||||
344,oni,5.2,5.3761797,0.17617969512939435
|
||||
1301,oni,2.0,2.720481,0.7204809188842773
|
||||
169,oni,3.7,4.180386,0.4803860664367674
|
||||
1370,oni,8.6,8.240398,0.35960159301757777
|
||||
346,oni,6.4,7.2758265,0.8758264541625973
|
||||
605,oni,6.9,7.0425806,0.1425806045532223
|
||||
479,oni,4.9,4.89305,0.0069498062133792615
|
||||
106,oni,5.1,5.164285,0.06428518295288121
|
||||
1313,oni,5.3,5.9597716,0.6597716331481935
|
||||
462,oni,7.3,6.5050087,0.7949913024902342
|
||||
662,oni,7.4,7.203708,0.19629182815551793
|
||||
998,oni,5.0,5.630293,0.6302928924560547
|
||||
436,oni,3.7,3.9809625,0.28096251487731916
|
||||
|
201
test/validate_result_2.csv
Normal file
201
test/validate_result_2.csv
Normal file
@@ -0,0 +1,201 @@
|
||||
songno,diff,상수,predicted_measure,error
|
||||
407,oni,7.4,7.7118516,0.31185159683227504
|
||||
639,oni,7.0,7.128337,0.12833690643310547
|
||||
1126,oni,3.9,4.162916,0.2629161834716798
|
||||
555,oni,11.3,9.773656,1.5263441085815437
|
||||
874,oni,7.0,7.1630692,0.1630692481994629
|
||||
90,oni,5.6,6.219878,0.619878196716309
|
||||
1043,oni,9.8,9.010322,0.7896783828735359
|
||||
680,oni,7.9,8.108603,0.20860252380371058
|
||||
418,oni,8.2,6.1271896,2.0728103637695305
|
||||
1348,oni,6.7,4.6488576,2.0511424064636232
|
||||
39,oni,5.6,6.254499,0.6544989585876468
|
||||
1403,oni,5.0,4.69633,0.30366992950439453
|
||||
1208,oni,4.3,4.714694,0.4146940231323244
|
||||
652,oni,3.7,3.638977,0.06102294921875018
|
||||
266,oni,6.3,8.5091305,2.2091304779052736
|
||||
1032,oni,3.9,4.147311,0.2473112106323243
|
||||
1053,oni,4.6,4.974226,0.37422599792480504
|
||||
278,oni,3.8,4.252946,0.4529458999633791
|
||||
381,oni,2.3,4.2555227,1.9555227279663088
|
||||
1044,oni,5.3,3.7092085,1.5907915115356444
|
||||
927,oni,8.9,8.400599,0.4994014739990238
|
||||
363,oni,8.1,8.048794,0.05120620727539027
|
||||
980,oni,8.8,8.687542,0.11245803833007884
|
||||
699,oni,9.7,9.935864,0.235864448547364
|
||||
914,oni,8.7,8.6761675,0.023832511901854758
|
||||
1199,oni,4.3,2.9498258,1.3501742362976072
|
||||
765,oni,11.9,10.781875,1.1181253433227543
|
||||
753,oni,5.3,5.75474,0.45474023818969744
|
||||
779,oni,8.5,8.14912,0.3508796691894531
|
||||
1425,oni,7.9,8.336508,0.4365077972412106
|
||||
324,oni,5.6,5.707896,0.10789623260498082
|
||||
974,oni,1.5,2.5264485,1.0264484882354736
|
||||
1104,oni,9.7,9.071495,0.6285049438476555
|
||||
462,oni,7.3,6.2004747,1.0995252609252928
|
||||
627,oni,11.5,9.855917,1.644083023071289
|
||||
968,oni,7.0,7.2786546,0.2786545753479004
|
||||
1410,oni,3.0,3.9265063,0.9265062808990479
|
||||
972,oni,7.5,6.7958617,0.7041382789611816
|
||||
569,oni,7.2,8.108791,0.9087913513183592
|
||||
574,oni,8.6,8.728794,0.12879409790039098
|
||||
118,oni,3.0,3.6167395,0.6167395114898682
|
||||
561,oni,5.5,5.479089,0.020911216735839844
|
||||
990,oni,10.9,9.822301,1.0776990890502933
|
||||
1067,oni,9.2,8.314178,0.8858215332031243
|
||||
17,oni,7.3,7.1151476,0.1848524093627928
|
||||
256,oni,4.9,4.069125,0.8308748245239261
|
||||
846,oni,8.5,8.806922,0.30692195892333984
|
||||
1243,oni,1.1,2.1853628,1.0853628158569335
|
||||
76,oni,3.5,4.2370133,0.7370133399963379
|
||||
1414,oni,5.2,4.528089,0.6719109535217287
|
||||
43,oni,8.1,7.666461,0.4335390090942379
|
||||
1280,oni,3.9,4.175297,0.2752967834472657
|
||||
1066,oni,11.0,9.642129,1.3578710556030273
|
||||
1160,oni,6.3,6.311124,0.011123847961425959
|
||||
571,oni,9.1,7.8507853,1.2492147445678707
|
||||
572,oni,8.3,7.7374845,0.5625155448913581
|
||||
137,oni,6.1,6.2259655,0.12596549987793004
|
||||
673,oni,8.9,7.898995,1.001005077362061
|
||||
668,oni,3.4,3.8651383,0.46513829231262216
|
||||
1407,oni,2.8,3.590128,0.7901279449462892
|
||||
483,oni,7.1,6.679802,0.4201980590820309
|
||||
307,oni,4.1,4.5094666,0.409466648101807
|
||||
1352,oni,8.0,9.46934,1.4693403244018555
|
||||
155,oni,7.2,6.6420507,0.5579492568969728
|
||||
1233,oni,4.1,4.225732,0.1257318496704105
|
||||
623,oni,5.0,4.3235593,0.6764407157897949
|
||||
1450,oni,2.9,3.1810834,0.28108344078063974
|
||||
777,oni,10.8,9.084598,1.7154024124145515
|
||||
1322,oni,7.9,8.072512,0.17251167297363246
|
||||
593,oni,10.6,9.33769,1.262309646606445
|
||||
1426,oni,6.2,5.1146894,1.0853106498718263
|
||||
526,oni,7.9,7.9039993,0.003999328613280895
|
||||
1451,oni,5.1,5.3727984,0.2727984428405765
|
||||
1018,oni,4.9,4.897191,0.002808952331543324
|
||||
139,oni,4.8,5.9494166,1.1494166374206545
|
||||
988,oni,5.3,7.3648434,2.0648433685302736
|
||||
1052,oni,8.1,7.9982395,0.10176048278808558
|
||||
148,oni,9.7,9.190443,0.5095569610595696
|
||||
781,oni,10.1,9.420827,0.6791730880737301
|
||||
136,oni,9.1,8.9569,0.1431003570556637
|
||||
1138,oni,4.1,4.5386105,0.4386104583740238
|
||||
573,oni,8.0,7.7697043,0.23029565811157227
|
||||
689,oni,4.3,4.3181367,0.018136692047119318
|
||||
823,oni,5.8,5.803063,0.0030629158020021308
|
||||
1319,oni,8.8,8.832512,0.03251190185546804
|
||||
1447,oni,10.4,8.193739,2.2062610626220707
|
||||
771,oni,3.3,3.8071642,0.5071641921997072
|
||||
920,oni,4.9,5.6871243,0.7871242523193356
|
||||
928,oni,10.3,8.788698,1.511301803588868
|
||||
100,oni,5.3,5.470746,0.17074604034423846
|
||||
1305,oni,7.8,7.1164837,0.6835163116455076
|
||||
1465,oni,6.8,6.7193513,0.08064870834350568
|
||||
1081,oni,5.4,5.8754663,0.4754663467407223
|
||||
1264,oni,7.5,7.5121713,0.012171268463134766
|
||||
1026,oni,4.1,4.4330683,0.3330682754516605
|
||||
856,oni,8.8,8.940483,0.14048309326171804
|
||||
214,oni,7.8,7.827591,0.027590942382812678
|
||||
714,oni,9.4,6.447624,2.9523757934570316
|
||||
1183,oni,6.5,6.3542147,0.14578533172607422
|
||||
1336,oni,2.9,3.8588686,0.9588685989379884
|
||||
626,oni,6.3,6.305609,0.005609226226806818
|
||||
754,oni,5.0,5.492872,0.4928722381591797
|
||||
364,oni,5.2,5.2130685,0.013068485260009588
|
||||
352,oni,2.5,4.5982647,2.098264694213867
|
||||
1192,oni,5.7,5.5247087,0.17529125213623065
|
||||
1281,oni,2.2,2.4992957,0.2992957115173338
|
||||
1241,oni,5.0,4.964304,0.03569602966308594
|
||||
120,oni,11.9,9.389377,2.510623359680176
|
||||
467,oni,2.9,3.4955206,0.5955205917358399
|
||||
758,oni,10.8,9.998916,0.8010843276977546
|
||||
1191,oni,5.4,5.5138097,0.11380968093872035
|
||||
747,oni,7.3,6.978402,0.32159786224365217
|
||||
969,oni,5.6,5.6307874,0.030787372589111683
|
||||
773,oni,4.0,4.538554,0.5385541915893555
|
||||
1110,oni,1.7,2.6193855,0.9193854808807373
|
||||
1335,oni,4.0,4.2992277,0.2992277145385742
|
||||
630,oni,9.3,8.60483,0.6951702117919929
|
||||
115,oni,2.3,4.1506577,1.850657653808594
|
||||
1394,oni,10.3,9.72695,0.5730503082275398
|
||||
745,oni,10.4,9.549488,0.8505119323730472
|
||||
1423,oni,4.7,4.4789248,0.2210752487182619
|
||||
1145,oni,7.2,6.2197733,0.9802267074584963
|
||||
67,oni,7.6,7.0234313,0.5765686988830563
|
||||
1202,oni,4.8,4.632943,0.16705684661865217
|
||||
126,oni,4.6,4.020031,0.5799690246582028
|
||||
1096,oni,5.1,4.463463,0.6365371704101559
|
||||
1301,oni,2.0,2.8766239,0.8766238689422607
|
||||
141,oni,4.6,4.6933184,0.09331836700439489
|
||||
1275,oni,4.1,6.1221576,2.0221575736999515
|
||||
424,oni,6.3,6.322995,0.02299518585205096
|
||||
215,oni,6.6,6.9068832,0.3068832397460941
|
||||
1310,oni,6.0,4.274131,1.7258691787719727
|
||||
314,oni,1.3,2.937756,1.637756061553955
|
||||
808,oni,6.2,5.1405373,1.0594627380371096
|
||||
1244,oni,1.6,3.5983038,1.9983037948608398
|
||||
686,oni,8.7,7.853119,0.8468811035156243
|
||||
152,oni,7.9,8.261536,0.36153564453124964
|
||||
1412,oni,6.2,6.2849617,0.08496170043945295
|
||||
446,oni,6.8,6.535924,0.2640760421752928
|
||||
1136,oni,2.7,3.8286126,1.1286125659942625
|
||||
449,oni,8.1,7.7637753,0.33622465133666957
|
||||
86,oni,6.8,6.7608147,0.03918533325195295
|
||||
194,oni,9.4,7.5551414,1.844858551025391
|
||||
1413,oni,7.6,7.0943885,0.5056115150451657
|
||||
159,oni,7.5,7.6529474,0.15294742584228516
|
||||
1146,oni,7.5,7.5121713,0.012171268463134766
|
||||
984,oni,4.2,4.733321,0.5333211898803709
|
||||
53,oni,6.4,6.609403,0.20940313339233363
|
||||
861,oni,4.2,4.521036,0.3210361480712889
|
||||
1424,oni,6.4,6.31289,0.0871099472045902
|
||||
85,oni,7.4,5.647832,1.7521680831909183
|
||||
55,oni,8.7,7.400382,1.299617958068847
|
||||
1307,oni,6.9,7.1966534,0.29665336608886683
|
||||
1333,oni,1.7,2.1893477,0.48934774398803715
|
||||
1313,oni,5.3,5.455302,0.15530176162719744
|
||||
21,oni,8.1,7.816301,0.28369913101196254
|
||||
1103,oni,4.8,4.99246,0.19245977401733416
|
||||
1054,oni,3.9,4.2977943,0.3977943420410157
|
||||
1193,oni,4.4,4.5527945,0.15279445648193324
|
||||
1050,oni,9.2,8.187371,1.0126287460327141
|
||||
672,oni,2.4,3.8383086,1.4383085727691651
|
||||
432,oni,6.6,6.8880315,0.28803148269653356
|
||||
650,oni,6.4,6.191967,0.20803298950195348
|
||||
1420,oni,3.7,3.585551,0.11444897651672381
|
||||
940,oni,9.1,8.561063,0.5389371871948239
|
||||
10,oni,7.8,7.303648,0.49635200500488263
|
||||
309,oni,6.6,5.9738116,0.6261883735656735
|
||||
114,oni,7.0,7.161101,0.1611008644104004
|
||||
261,oni,7.4,7.657537,0.2575369834899899
|
||||
477,oni,9.3,9.070963,0.22903709411621165
|
||||
670,oni,8.1,8.589176,0.489176177978516
|
||||
536,oni,6.7,6.779605,0.07960491180419904
|
||||
113,oni,5.7,5.5914326,0.10856742858886737
|
||||
575,oni,9.8,6.3821473,3.417852687835694
|
||||
179,oni,10.2,9.090903,1.109096717834472
|
||||
693,oni,4.6,4.6827374,0.08273735046386754
|
||||
107,oni,4.6,4.8170347,0.21703472137451207
|
||||
384,oni,2.1,3.6001546,1.5001546382904052
|
||||
146,oni,4.1,4.492044,0.3920439720153812
|
||||
178,oni,6.8,6.463874,0.336126136779785
|
||||
1174,oni,6.2,6.399553,0.19955282211303693
|
||||
1271,oni,4.8,4.3153443,0.4846556663513182
|
||||
1343,oni,1.4,2.935083,1.5350829124450684
|
||||
798,oni,9.1,8.743355,0.3566452026367184
|
||||
963,oni,7.1,6.6011505,0.49884948730468714
|
||||
850,oni,10.7,9.177441,1.5225593566894524
|
||||
1402,oni,5.8,4.785289,1.0147111892700194
|
||||
367,oni,5.8,6.2457614,0.4457613945007326
|
||||
1362,oni,6.1,5.7599487,0.34005126953124964
|
||||
1370,oni,8.6,8.127836,0.47216377258300746
|
||||
1175,oni,4.5,4.550432,0.05043220520019531
|
||||
345,oni,4.5,4.60553,0.10552978515625
|
||||
800,oni,7.3,6.731179,0.5688207626342772
|
||||
1411,oni,9.1,8.82227,0.2777296066284176
|
||||
380,oni,4.6,4.054151,0.5458489418029782
|
||||
1250,oni,6.0,6.232577,0.23257684707641602
|
||||
886,oni,1.9,3.3799245,1.4799245357513429
|
||||
427,oni,9.1,8.462549,0.6374507904052731
|
||||
1286,oni,2.2,3.2965052,1.0965052127838133
|
||||
321,oni,6.3,6.2949524,0.005047607421874822
|
||||
|
201
test/validate_result_3.csv
Normal file
201
test/validate_result_3.csv
Normal file
@@ -0,0 +1,201 @@
|
||||
songno,diff,상수,predicted_measure,error
|
||||
1333,oni,1.7,2.1903424,0.4903424263000489
|
||||
503,oni,11.3,9.012293,2.287707138061524
|
||||
273,oni,3.3,3.3733163,0.07331628799438494
|
||||
1043,oni,9.8,8.805077,0.994923400878907
|
||||
82,oni,5.7,3.7766702,1.923329782485962
|
||||
973,oni,4.0,5.0434604,1.0434603691101074
|
||||
1076,oni,2.1,2.9520278,0.8520277976989745
|
||||
512,oni,3.4,4.0293465,0.6293464660644532
|
||||
367,oni,5.8,5.824023,0.024022769927978693
|
||||
1334,oni,4.0,4.304007,0.30400705337524414
|
||||
246,oni,1.1,3.409812,2.3098119735717773
|
||||
438,oni,7.7,7.679233,0.020766925811767756
|
||||
764,oni,11.2,9.896853,1.30314655303955
|
||||
19,oni,7.5,6.6001863,0.8998136520385742
|
||||
422,oni,3.0,4.4134846,1.4134845733642578
|
||||
1014,oni,5.3,5.425547,0.12554712295532244
|
||||
1307,oni,6.9,7.224358,0.3243580818176266
|
||||
1149,oni,3.8,5.3673983,1.567398262023926
|
||||
819,oni,8.6,7.9465976,0.6534024238586422
|
||||
998,oni,5.0,5.2953377,0.2953376770019531
|
||||
1417,oni,4.2,4.0317307,0.16826934814453143
|
||||
1268,oni,6.3,6.2643814,0.03561859130859357
|
||||
1450,oni,2.9,2.9973252,0.09732518196105966
|
||||
80,oni,8.4,8.044008,0.35599174499511754
|
||||
1337,oni,3.9,5.037738,1.1377378463745118
|
||||
83,oni,6.0,5.979888,0.020112037658691406
|
||||
465,oni,6.9,7.4996314,0.5996314048767086
|
||||
323,oni,4.3,4.1757064,0.12429361343383771
|
||||
396,oni,5.8,6.364714,0.5647141456604006
|
||||
207,oni,4.2,3.5814035,0.6185965061187746
|
||||
546,oni,6.8,6.922099,0.12209911346435565
|
||||
886,oni,1.9,3.2264843,1.3264842987060548
|
||||
5,oni,8.3,8.024653,0.27534656524658274
|
||||
259,oni,6.6,6.3496404,0.25035963058471644
|
||||
470,oni,5.0,5.19226,0.1922597885131836
|
||||
689,oni,4.3,4.29064,0.009360122680663885
|
||||
537,oni,6.9,7.8368387,0.9368387222290036
|
||||
748,oni,10.8,9.44193,1.3580701828002937
|
||||
558,oni,8.5,8.089595,0.41040515899658203
|
||||
339,oni,6.8,3.8407266,2.9592733860015867
|
||||
1171,oni,6.1,5.2119055,0.8880945205688473
|
||||
430,oni,1.5,3.211008,1.711008071899414
|
||||
40,oni,4.6,4.4078455,0.192154502868652
|
||||
266,oni,6.3,8.231991,1.9319908142089846
|
||||
1162,oni,3.9,3.978352,0.07835206985473642
|
||||
997,oni,4.0,4.5425763,0.5425763130187988
|
||||
908,oni,6.0,5.789243,0.21075677871704102
|
||||
1080,oni,8.0,8.286018,0.28601837158203125
|
||||
487,oni,3.5,5.0209293,1.5209293365478516
|
||||
552,oni,6.5,6.185847,0.31415319442749023
|
||||
852,oni,6.6,5.719363,0.8806367874145504
|
||||
267,oni,3.6,3.7225535,0.12255349159240714
|
||||
898,oni,3.8,4.8149214,1.0149213790893556
|
||||
1391,oni,7.8,7.943273,0.1432730674743654
|
||||
1042,oni,10.1,8.874695,1.2253051757812496
|
||||
823,oni,5.8,5.9181585,0.11815853118896502
|
||||
1370,oni,8.6,8.115248,0.48475227355956996
|
||||
264,oni,4.8,5.9249053,1.124905300140381
|
||||
491,oni,8.2,7.98736,0.21263999938964773
|
||||
753,oni,5.3,5.92183,0.6218301773071291
|
||||
383,oni,6.1,5.850947,0.24905309677123988
|
||||
310,oni,6.2,6.476375,0.276375102996826
|
||||
1081,oni,5.4,5.913851,0.5138507843017575
|
||||
610,oni,6.0,6.194362,0.19436216354370117
|
||||
8,oni,2.2,3.7589507,1.5589507102966307
|
||||
716,oni,6.8,4.285139,2.514860916137695
|
||||
1452,oni,8.1,8.181307,0.08130683898925817
|
||||
698,oni,9.9,9.351179,0.5488208770751957
|
||||
843,oni,10.0,9.872733,0.12726688385009766
|
||||
1181,oni,3.3,3.4767451,0.17674512863159197
|
||||
739,oni,7.1,7.91916,0.8191598892211918
|
||||
933,oni,7.1,7.2560177,0.1560176849365238
|
||||
540,oni,5.9,6.3700414,0.47004137039184535
|
||||
1206,oni,7.6,7.545701,0.05429897308349574
|
||||
108,oni,6.8,7.3288846,0.5288846015930178
|
||||
685,oni,10.4,9.550256,0.8497442245483402
|
||||
52,oni,5.2,7.3442254,2.1442254066467283
|
||||
573,oni,8.0,7.9685845,0.031415462493896484
|
||||
948,oni,8.3,8.540495,0.24049491882324148
|
||||
115,oni,2.3,3.847257,1.547256898880005
|
||||
672,oni,2.4,3.7155921,1.3155921459198
|
||||
817,oni,8.0,8.163437,0.1634368896484375
|
||||
1245,oni,8.4,7.0591817,1.340818309783936
|
||||
124,oni,5.5,5.8749466,0.37494659423828125
|
||||
578,oni,6.5,5.2521996,1.247800350189209
|
||||
1120,oni,8.2,8.444323,0.24432258605957102
|
||||
251,oni,8.1,7.758801,0.34119901657104457
|
||||
374,oni,5.4,5.484437,0.08443698883056605
|
||||
184,oni,5.2,5.0207753,0.17922468185424822
|
||||
193,oni,4.4,5.0985303,0.698530292510986
|
||||
1164,oni,5.4,5.888622,0.4886218070983883
|
||||
1348,oni,6.7,4.703537,1.9964630126953127
|
||||
248,oni,6.2,6.2511435,0.051143455505370916
|
||||
1218,oni,1.4,3.0043902,1.6043902397155763
|
||||
993,oni,10.0,9.044949,0.9550514221191406
|
||||
416,oni,6.0,5.5991735,0.40082645416259766
|
||||
215,oni,6.6,6.7813444,0.18134441375732457
|
||||
1227,oni,10.8,9.060002,1.7399976730346687
|
||||
980,oni,8.8,8.230598,0.5694015502929695
|
||||
1173,oni,9.2,8.644381,0.5556194305419915
|
||||
858,oni,11.1,9.593632,1.506368255615234
|
||||
467,oni,2.9,3.0634747,0.16347465515136728
|
||||
142,oni,3.0,3.8290024,0.8290023803710938
|
||||
496,oni,6.1,5.730025,0.36997518539428675
|
||||
542,oni,4.2,4.336454,0.1364539146423338
|
||||
697,oni,9.9,9.066247,0.8337530136108402
|
||||
989,oni,6.4,6.5791917,0.17919168472290004
|
||||
199,oni,3.1,3.9743605,0.8743604660034179
|
||||
283,oni,8.5,8.147985,0.35201454162597656
|
||||
1347,oni,6.9,6.7535005,0.14649953842163121
|
||||
614,oni,6.4,6.2811537,0.11884632110595739
|
||||
9,oni,2.0,3.9813426,1.9813425540924072
|
||||
640,oni,8.5,7.8518143,0.6481857299804688
|
||||
758,oni,10.8,9.828485,0.9715154647827156
|
||||
421,oni,7.9,7.7221074,0.17789258956909215
|
||||
293,oni,3.9,4.4382343,0.5382343292236329
|
||||
939,oni,7.4,7.338523,0.06147708892822301
|
||||
706,oni,3.3,3.3895915,0.0895914554595949
|
||||
824,oni,1.3,2.5118618,1.211861801147461
|
||||
405,oni,3.1,5.136325,2.036324882507324
|
||||
1099,oni,11.0,8.952359,2.047640800476074
|
||||
778,oni,11.0,9.19712,1.8028802871704102
|
||||
575,oni,9.8,6.442831,3.3571689605712898
|
||||
478,oni,5.8,4.6577578,1.1422422409057615
|
||||
809,oni,3.4,3.8239646,0.4239645957946778
|
||||
1393,oni,5.2,5.08671,0.11329002380371112
|
||||
1086,oni,10.6,9.258747,1.3412528991699215
|
||||
1157,oni,4.6,4.127116,0.4728837966918942
|
||||
403,oni,5.3,5.630022,0.3300220489501955
|
||||
551,oni,4.5,4.34725,0.15275001525878906
|
||||
762,oni,10.3,10.338216,0.03821582794189382
|
||||
1437,oni,7.5,7.6820364,0.1820363998413086
|
||||
431,oni,7.6,7.6921387,0.09213867187500036
|
||||
1278,oni,11.7,9.379224,2.320776176452636
|
||||
307,oni,4.1,4.407159,0.3071588516235355
|
||||
523,oni,5.1,4.0887995,1.0112005233764645
|
||||
168,oni,8.6,8.250107,0.34989318847656214
|
||||
609,oni,5.8,5.091381,0.708618927001953
|
||||
1001,oni,3.6,3.6851382,0.08513822555541983
|
||||
1168,oni,4.0,4.1760807,0.17608070373535156
|
||||
878,oni,9.7,8.739927,0.9600727081298821
|
||||
1389,oni,1.2,3.206175,2.006175088882446
|
||||
1233,oni,4.1,4.099706,0.00029382705688441035
|
||||
677,oni,8.9,8.329707,0.5702928543090824
|
||||
181,oni,8.5,8.747985,0.2479848861694336
|
||||
1240,oni,4.2,4.060649,0.1393510818481447
|
||||
121,oni,9.3,7.560639,1.7393610954284675
|
||||
1318,oni,8.9,8.384992,0.5150083541870121
|
||||
138,oni,7.7,7.6900344,0.009965610504150568
|
||||
406,oni,7.7,4.9832273,2.716772747039795
|
||||
477,oni,9.3,8.961975,0.3380249023437507
|
||||
1297,oni,9.4,8.435677,0.9643234252929691
|
||||
1249,oni,8.3,8.439436,0.13943595886230398
|
||||
695,oni,8.3,8.01719,0.28281002044677805
|
||||
1217,oni,4.7,5.1999345,0.4999344825744627
|
||||
498,oni,6.7,3.6178725,3.0821275234222414
|
||||
447,oni,4.0,4.4167833,0.41678333282470703
|
||||
1305,oni,7.8,7.000083,0.7999170303344725
|
||||
79,oni,3.2,4.5878086,1.3878086090087889
|
||||
1012,oni,9.7,8.778496,0.9215042114257805
|
||||
662,oni,7.4,7.043864,0.3561362266540531
|
||||
445,oni,7.1,6.4310493,0.6689506530761715
|
||||
1201,oni,1.9,3.5991864,1.699186420440674
|
||||
305,oni,3.7,4.0024614,0.30246143341064435
|
||||
306,oni,6.3,6.189409,0.11059122085571271
|
||||
418,oni,8.2,6.2207007,1.9792992591857903
|
||||
1036,oni,6.5,6.179061,0.3209390640258789
|
||||
87,oni,5.6,5.6751432,0.07514324188232457
|
||||
101,oni,1.4,2.8444297,1.4444297313690186
|
||||
1062,oni,5.0,3.9868214,1.0131785869598389
|
||||
629,oni,7.3,7.7802644,0.4802643775939943
|
||||
230,oni,7.4,6.63587,0.7641300201416019
|
||||
828,oni,4.1,5.226594,1.1265939712524418
|
||||
1117,oni,2.9,3.8603442,0.9603441715240479
|
||||
135,oni,4.1,3.329655,0.7703450679779049
|
||||
1418,oni,8.0,7.9330883,0.06691169738769531
|
||||
1237,oni,4.5,4.542555,0.04255485534667969
|
||||
1193,oni,4.4,4.488823,0.0888229370117184
|
||||
1373,oni,2.1,3.6980665,1.598066473007202
|
||||
660,oni,6.6,6.3700333,0.2299667358398434
|
||||
666,oni,6.7,7.559406,0.8594058036804197
|
||||
1169,oni,3.6,4.3033247,0.7033246994018554
|
||||
380,oni,4.6,3.8044093,0.7955907344818112
|
||||
1084,oni,2.6,3.501814,0.9018138885498046
|
||||
513,oni,8.4,8.012544,0.38745632171630895
|
||||
281,oni,4.2,4.9308815,0.7308815002441404
|
||||
587,oni,5.2,5.157128,0.042872142791748225
|
||||
1040,oni,11.6,9.7729645,1.8270355224609371
|
||||
186,oni,10.9,9.611557,1.2884429931640629
|
||||
1229,oni,9.7,8.602953,1.097047042846679
|
||||
139,oni,4.8,5.99956,1.1995598793029787
|
||||
1449,oni,8.9,8.878569,0.021431350708008168
|
||||
964,oni,2.4,3.0497062,0.6497062206268311
|
||||
745,oni,10.4,9.4432955,0.9567045211791996
|
||||
1004,oni,5.9,5.352998,0.547002220153809
|
||||
732,oni,2.4,3.0829518,0.6829517841339112
|
||||
1267,oni,4.7,4.5356736,0.1643263816833498
|
||||
1435,oni,5.2,4.3815727,0.8184272766113283
|
||||
680,oni,7.9,8.044945,0.1449447631835934
|
||||
1013,oni,8.3,6.855718,1.4442818641662605
|
||||
|
201
test/validate_result_4.csv
Normal file
201
test/validate_result_4.csv
Normal file
@@ -0,0 +1,201 @@
|
||||
songno,diff,상수,predicted_measure,error
|
||||
1337,oni,3.9,4.9201913,1.0201912879943849
|
||||
1207,oni,7.8,7.6752043,0.1247957229614256
|
||||
34,oni,6.3,5.754303,0.5456970214843748
|
||||
1033,oni,4.3,4.294703,0.005296993255615057
|
||||
493,oni,3.8,4.2889194,0.48891944885253924
|
||||
1201,oni,1.9,3.9247124,2.024712419509888
|
||||
705,oni,5.4,5.307041,0.09295883178710973
|
||||
126,oni,4.6,3.4666567,1.1333433151245114
|
||||
397,oni,7.9,7.927455,0.027454948425292613
|
||||
117,oni,8.0,7.2873235,0.7126765251159668
|
||||
1166,oni,7.8,7.3694544,0.43054561614990217
|
||||
52,oni,5.2,6.9084826,1.7084825515747069
|
||||
1001,oni,3.6,3.6689627,0.06896271705627433
|
||||
363,oni,8.1,7.9964867,0.10351333618164027
|
||||
221,oni,6.7,6.3216214,0.3783785820007326
|
||||
1096,oni,5.1,3.9809358,1.1190641880035397
|
||||
348,oni,3.9,4.004658,0.10465822219848642
|
||||
163,oni,5.8,5.8238277,0.023827743530273615
|
||||
1329,oni,7.4,6.373964,1.0260361671447757
|
||||
963,oni,7.1,6.7132926,0.3867074012756344
|
||||
399,oni,7.6,7.8508854,0.2508853912353519
|
||||
826,oni,10.5,9.921691,0.5783090591430664
|
||||
526,oni,7.9,7.8841443,0.015855693817139027
|
||||
1364,oni,7.7,7.1662784,0.5337216377258303
|
||||
843,oni,10.0,8.314847,1.6851530075073242
|
||||
360,oni,9.2,8.815349,0.3846513748168938
|
||||
181,oni,8.5,8.725624,0.22562408447265625
|
||||
558,oni,8.5,8.070021,0.4299793243408203
|
||||
1029,oni,1.6,2.0737321,0.4737321376800536
|
||||
1178,oni,3.5,3.5148704,0.014870405197143555
|
||||
1333,oni,1.7,2.0008903,0.3008902549743653
|
||||
401,oni,11.3,8.855692,2.4443080902099616
|
||||
411,oni,4.8,3.94091,0.8590898990631102
|
||||
942,oni,5.5,5.424328,0.07567214965820312
|
||||
268,oni,5.1,3.6398425,1.460157489776611
|
||||
968,oni,7.0,7.418691,0.41869115829467773
|
||||
112,oni,6.5,6.4688077,0.031192302703857422
|
||||
420,oni,4.3,4.05865,0.24134998321533185
|
||||
1352,oni,8.0,9.510268,1.510268211364746
|
||||
1402,oni,5.8,4.687088,1.1129119873046873
|
||||
1136,oni,2.7,3.6673882,0.9673882007598875
|
||||
1377,oni,4.9,4.631454,0.26854600906372106
|
||||
134,oni,6.4,6.522638,0.122637844085693
|
||||
459,oni,5.6,4.9065027,0.693497276306152
|
||||
1262,oni,4.3,4.293586,0.006414222717284979
|
||||
487,oni,3.5,4.7952247,1.295224666595459
|
||||
551,oni,4.5,3.831213,0.6687870025634766
|
||||
951,oni,4.2,4.3512354,0.15123538970947248
|
||||
1279,oni,8.4,8.2399845,0.1600154876708988
|
||||
286,oni,10.0,8.290865,1.7091350555419922
|
||||
408,oni,3.6,4.492062,0.8920620918273925
|
||||
1012,oni,9.7,8.790352,0.909648132324218
|
||||
159,oni,7.5,8.047567,0.5475673675537109
|
||||
926,oni,3.7,4.282581,0.5825808525085447
|
||||
1098,oni,5.9,4.214736,1.6852640151977543
|
||||
45,oni,7.9,8.278758,0.3787580490112301
|
||||
284,oni,3.8,3.6999052,0.10009484291076642
|
||||
105,oni,2.9,3.1325843,0.2325843334197999
|
||||
1366,oni,4.7,4.6957006,0.004299354553222834
|
||||
111,oni,4.7,5.4332376,0.7332375526428221
|
||||
641,oni,8.4,8.34599,0.054009819030762074
|
||||
764,oni,11.2,9.98334,1.2166597366333
|
||||
504,oni,6.1,6.6229615,0.522961521148682
|
||||
76,oni,3.5,4.1206527,0.6206526756286621
|
||||
681,oni,7.0,6.803703,0.19629716873168945
|
||||
1212,oni,1.4,1.9212408,0.5212408065795899
|
||||
709,oni,2.5,4.042969,1.5429692268371582
|
||||
1034,oni,5.9,5.8697777,0.03022232055664098
|
||||
337,oni,7.2,7.195378,0.0046221733093263495
|
||||
294,oni,4.3,5.326409,1.0264088630676271
|
||||
276,oni,3.7,4.33384,0.6338398933410643
|
||||
1382,oni,3.2,3.2742395,0.07423954010009748
|
||||
1408,oni,4.5,6.658769,2.158769130706787
|
||||
547,oni,3.8,3.8565905,0.05659050941467303
|
||||
233,oni,3.1,3.5813994,0.48139944076538077
|
||||
338,oni,9.3,8.389843,0.9101570129394538
|
||||
422,oni,3.0,4.6032124,1.6032123565673828
|
||||
388,oni,9.0,8.323626,0.6763744354248047
|
||||
881,oni,7.7,7.1750007,0.5249993324279787
|
||||
108,oni,6.8,7.4059315,0.6059314727783205
|
||||
801,oni,4.6,2.9960365,1.603963470458984
|
||||
1130,oni,5.9,6.076717,0.17671689987182582
|
||||
482,oni,1.8,2.9453332,1.1453332424163818
|
||||
1369,oni,11.8,10.97657,0.8234298706054695
|
||||
1400,oni,1.6,2.9903936,1.3903936386108398
|
||||
1192,oni,5.7,5.3933945,0.3066055297851564
|
||||
723,oni,9.9,9.048461,0.8515390396118168
|
||||
680,oni,7.9,7.9447618,0.044761753082275035
|
||||
1200,oni,2.4,3.3235924,0.9235924243927003
|
||||
457,oni,6.5,6.2823706,0.21762943267822266
|
||||
1202,oni,4.8,4.7704597,0.029540348052978338
|
||||
456,oni,8.2,8.089962,0.11003799438476491
|
||||
574,oni,8.6,8.3967705,0.20322952270507777
|
||||
1375,oni,1.1,2.0934286,0.993428611755371
|
||||
644,oni,4.4,4.321287,0.07871284484863317
|
||||
67,oni,7.6,6.8966484,0.7033515930175778
|
||||
572,oni,8.3,7.814058,0.4859421730041511
|
||||
274,oni,4.3,4.5839643,0.28396434783935565
|
||||
196,oni,5.3,5.485792,0.18579216003417987
|
||||
991,oni,6.3,6.10526,0.1947401046752928
|
||||
213,oni,6.1,5.7994084,0.30059156417846644
|
||||
253,oni,5.0,5.378026,0.37802600860595703
|
||||
410,oni,6.6,7.13773,0.5377301216125492
|
||||
1349,oni,6.3,4.7093983,1.5906017303466795
|
||||
553,oni,4.7,7.3266306,2.6266305923461912
|
||||
109,oni,4.6,4.961087,0.36108722686767614
|
||||
267,oni,3.6,3.946393,0.3463930130004882
|
||||
36,oni,1.6,2.5664647,0.9664646625518798
|
||||
833,oni,9.6,9.078208,0.5217920303344723
|
||||
579,oni,7.2,5.035543,2.1644570350646974
|
||||
1311,oni,6.7,6.150234,0.5497657775878908
|
||||
861,oni,4.2,4.4580975,0.258097457885742
|
||||
887,oni,7.2,7.168689,0.03131122589111346
|
||||
1431,oni,7.8,7.4101872,0.3898127555847166
|
||||
1293,oni,3.8,3.8643973,0.06439728736877459
|
||||
454,oni,7.7,7.0873404,0.6126596450805666
|
||||
1021,oni,7.0,5.7251973,1.2748026847839355
|
||||
236,oni,2.2,4.3378987,2.1378987312316893
|
||||
273,oni,3.3,3.7149804,0.4149803638458254
|
||||
35,oni,3.1,3.2889068,0.1889068126678466
|
||||
1073,oni,2.3,2.8221462,0.5221461772918703
|
||||
1283,oni,2.2,2.7143157,0.5143156528472899
|
||||
1297,oni,9.4,8.1483135,1.2516864776611332
|
||||
1159,oni,7.1,6.1028767,0.9971233367919918
|
||||
1277,oni,5.0,4.8191442,0.18085575103759766
|
||||
831,oni,1.2,1.9079987,0.7079986810684205
|
||||
1122,oni,7.8,7.187955,0.612045097351074
|
||||
146,oni,4.1,4.8564696,0.7564696311950687
|
||||
1048,oni,9.4,8.600496,0.7995037078857425
|
||||
1417,oni,4.2,4.5280714,0.3280714035034178
|
||||
317,oni,2.9,3.8885484,0.9885483741760255
|
||||
1409,oni,2.1,3.1322389,1.0322388648986816
|
||||
1362,oni,6.1,5.5937595,0.5062404632568356
|
||||
782,oni,2.7,3.47081,0.7708099365234373
|
||||
671,oni,2.6,3.5076156,0.907615566253662
|
||||
489,oni,4.7,2.9095883,1.79041166305542
|
||||
1193,oni,4.4,4.468303,0.06830320358276332
|
||||
1306,oni,4.9,4.706141,0.1938590049743656
|
||||
344,oni,5.2,5.4134874,0.21348743438720685
|
||||
136,oni,9.1,8.873852,0.22614822387695277
|
||||
150,oni,6.3,5.7487135,0.5512865066528319
|
||||
1160,oni,6.3,6.4175167,0.11751670837402362
|
||||
1452,oni,8.1,8.06595,0.03404960632324183
|
||||
20,oni,8.3,8.227083,0.0729167938232429
|
||||
47,oni,5.1,5.2534966,0.15349664688110387
|
||||
725,oni,4.4,4.80065,0.4006501197814938
|
||||
842,oni,2.1,2.0496144,0.050385570526123136
|
||||
568,oni,7.5,7.3907185,0.10928153991699219
|
||||
805,oni,7.5,6.580787,0.919212818145752
|
||||
541,oni,5.6,5.596122,0.003878211975097301
|
||||
442,oni,10.3,7.816672,2.4833281517028816
|
||||
186,oni,10.9,9.709377,1.190622711181641
|
||||
732,oni,2.4,2.9659953,0.5659953117370606
|
||||
450,oni,9.0,8.494814,0.5051860809326172
|
||||
1198,oni,7.0,6.8871975,0.11280250549316406
|
||||
1061,oni,3.9,3.971574,0.0715740680694581
|
||||
324,oni,5.6,5.6469517,0.04695167541503942
|
||||
618,oni,5.0,5.210742,0.21074199676513672
|
||||
520,oni,6.7,6.91257,0.21256999969482404
|
||||
81,oni,4.4,4.985347,0.5853467941284176
|
||||
1280,oni,3.9,3.9405086,0.040508604049682706
|
||||
182,oni,6.4,4.7033157,1.696684265136719
|
||||
571,oni,9.1,7.9525375,1.147462463378906
|
||||
1393,oni,5.2,5.470408,0.2704079627990721
|
||||
1139,oni,5.9,5.873014,0.02698602676391637
|
||||
1235,oni,7.8,7.894454,0.09445400238037127
|
||||
785,oni,8.5,7.9694014,0.5305986404418945
|
||||
1080,oni,8.0,8.286955,0.2869548797607422
|
||||
1415,oni,3.6,3.6400633,0.04006328582763663
|
||||
959,oni,7.0,7.0137677,0.013767719268798828
|
||||
1225,oni,5.3,4.5744944,0.7255056381225584
|
||||
524,oni,8.9,8.816952,0.08304824829101598
|
||||
505,oni,3.0,5.910715,2.910715103149414
|
||||
747,oni,7.3,7.429628,0.1296278953552248
|
||||
1004,oni,5.9,5.3191657,0.5808342933654789
|
||||
1095,oni,6.2,4.935845,1.2641551017761232
|
||||
171,oni,9.6,8.53109,1.068910217285156
|
||||
305,oni,3.7,4.1035676,0.40356760025024396
|
||||
1090,oni,4.2,2.588543,1.6114570617675783
|
||||
792,oni,3.7,3.6583996,0.04160041809082049
|
||||
1105,oni,5.5,3.8440816,1.6559183597564697
|
||||
907,oni,7.9,8.013366,0.11336574554443324
|
||||
451,oni,7.2,6.9618473,0.23815269470214862
|
||||
372,oni,6.4,6.331269,0.06873121261596715
|
||||
384,oni,2.1,3.56338,1.4633800029754638
|
||||
474,oni,5.3,4.0164423,1.2835577011108397
|
||||
173,oni,6.0,6.407813,0.40781307220458984
|
||||
1328,oni,9.9,8.836618,1.0633815765380863
|
||||
243,oni,11.0,9.193796,1.806203842163086
|
||||
1405,oni,10.3,9.006471,1.2935293197631843
|
||||
212,oni,5.7,5.429469,0.2705308914184572
|
||||
761,oni,10.4,8.84694,1.5530599594116214
|
||||
653,oni,6.7,6.433655,0.2663452148437502
|
||||
797,oni,8.8,6.237135,2.562865066528321
|
||||
1006,oni,5.3,6.056387,0.7563869476318361
|
||||
12,oni,7.5,8.258375,0.7583751678466797
|
||||
1250,oni,6.0,6.185741,0.18574094772338867
|
||||
207,oni,4.2,3.9828024,0.21719760894775408
|
||||
629,oni,7.3,7.686902,0.38690204620361346
|
||||
1389,oni,1.2,3.2218568,2.0218568325042723
|
||||
|
201
test/validate_result_5.csv
Normal file
201
test/validate_result_5.csv
Normal file
@@ -0,0 +1,201 @@
|
||||
songno,diff,상수,predicted_measure,error
|
||||
47,oni,5.1,5.2534966,0.15349664688110387
|
||||
1419,oni,9.8,8.721249,1.0787513732910163
|
||||
955,oni,10.5,8.647183,1.8528165817260742
|
||||
831,oni,1.2,1.9079987,0.7079986810684205
|
||||
1375,oni,1.1,2.0934286,0.993428611755371
|
||||
617,oni,5.6,5.59698,0.003019905090331676
|
||||
705,oni,5.4,5.307041,0.09295883178710973
|
||||
67,oni,7.6,6.8966484,0.7033515930175778
|
||||
773,oni,4.0,4.5175767,0.5175766944885254
|
||||
230,oni,7.4,6.8955503,0.5044497489929203
|
||||
499,oni,8.8,7.927165,0.8728349685668952
|
||||
492,oni,1.9,1.962193,0.06219301223754892
|
||||
1039,oni,9.2,9.199211,0.0007888793945305395
|
||||
741,oni,3.5,3.9448667,0.4448666572570801
|
||||
1024,oni,3.3,3.8212879,0.5212878704071047
|
||||
95,oni,7.3,7.038092,0.2619078636169432
|
||||
352,oni,2.5,4.765403,2.2654027938842773
|
||||
1380,oni,6.9,6.3376403,0.562359714508057
|
||||
623,oni,5.0,4.3754272,0.62457275390625
|
||||
834,oni,9.7,7.9294763,1.7705237388610833
|
||||
27,oni,3.1,3.4906878,0.3906878471374511
|
||||
952,oni,10.0,9.086574,0.913426399230957
|
||||
1364,oni,7.7,7.1662784,0.5337216377258303
|
||||
709,oni,2.5,4.042969,1.5429692268371582
|
||||
783,oni,6.0,6.1265764,0.12657642364501953
|
||||
472,oni,5.9,6.1718836,0.2718835830688473
|
||||
268,oni,5.1,3.6398425,1.460157489776611
|
||||
1284,oni,2.3,3.4071481,1.1071481227874758
|
||||
253,oni,5.0,5.378026,0.37802600860595703
|
||||
1229,oni,9.7,8.730095,0.9699050903320305
|
||||
913,oni,2.1,4.303384,2.2033838272094726
|
||||
260,oni,8.8,7.734481,1.0655191421508796
|
||||
1149,oni,3.8,4.7081175,0.9081174850463869
|
||||
982,oni,9.9,8.680321,1.2196792602539066
|
||||
852,oni,6.6,5.918449,0.6815510749816891
|
||||
157,oni,3.3,3.2840455,0.015954542160034002
|
||||
1139,oni,5.9,5.873014,0.02698602676391637
|
||||
738,oni,7.9,6.910413,0.9895872116088871
|
||||
1414,oni,5.2,4.401258,0.7987420082092287
|
||||
220,oni,9.3,8.128048,1.1719520568847663
|
||||
964,oni,2.4,2.8287916,0.42879161834716806
|
||||
607,oni,4.8,3.5413032,1.2586968421936033
|
||||
348,oni,3.9,4.004658,0.10465822219848642
|
||||
707,oni,6.4,6.368574,0.03142585754394567
|
||||
534,oni,4.0,4.703994,0.7039937973022461
|
||||
1356,oni,9.4,8.823965,0.5760349273681644
|
||||
1031,oni,4.7,4.6495457,0.050454330444336115
|
||||
1302,oni,1.4,2.4271264,1.027126407623291
|
||||
895,oni,1.0,2.0652208,1.065220832824707
|
||||
1446,oni,8.0,6.1807137,1.8192863464355469
|
||||
1208,oni,4.3,5.1682663,0.8682662963867189
|
||||
171,oni,9.6,8.53109,1.068910217285156
|
||||
793,oni,3.1,4.031206,0.9312061309814452
|
||||
1381,oni,7.3,8.54008,1.2400800704956056
|
||||
510,oni,5.3,4.995711,0.30428915023803693
|
||||
1179,oni,5.0,5.2024164,0.20241641998291016
|
||||
1344,oni,4.7,3.441657,1.2583429336547853
|
||||
1172,oni,11.9,10.288958,1.611042404174805
|
||||
614,oni,6.4,6.02956,0.37043991088867223
|
||||
797,oni,8.8,6.237135,2.562865066528321
|
||||
1411,oni,9.1,8.657645,0.4423547744750973
|
||||
525,oni,6.6,6.05448,0.545519924163818
|
||||
166,oni,6.0,5.198671,0.8013291358947754
|
||||
399,oni,7.6,7.8508854,0.2508853912353519
|
||||
424,oni,6.3,6.354681,0.054681015014648615
|
||||
805,oni,7.5,6.580787,0.919212818145752
|
||||
1077,oni,3.9,4.035681,0.13568077087402353
|
||||
269,oni,9.5,8.653259,0.84674072265625
|
||||
246,oni,1.1,3.7854612,2.685461187362671
|
||||
408,oni,3.6,4.492062,0.8920620918273925
|
||||
967,oni,8.8,7.3684626,1.4315374374389656
|
||||
1160,oni,6.3,6.4175167,0.11751670837402362
|
||||
1196,oni,6.6,6.2342176,0.3657823562622067
|
||||
601,oni,3.5,3.8300495,0.3300495147705078
|
||||
1384,oni,9.3,8.139645,1.1603553771972663
|
||||
1146,oni,7.5,7.588489,0.08848905563354492
|
||||
660,oni,6.6,6.580023,0.019977188110351207
|
||||
183,oni,7.0,7.9340434,0.9340434074401855
|
||||
321,oni,6.3,6.504965,0.20496482849121112
|
||||
610,oni,6.0,6.1496606,0.14966058731079102
|
||||
2,oni,2.7,4.2753067,1.575306701660156
|
||||
124,oni,5.5,5.522645,0.022644996643066406
|
||||
89,oni,7.6,7.4246254,0.17537460327148402
|
||||
1400,oni,1.6,2.9903936,1.3903936386108398
|
||||
722,oni,9.4,8.443125,0.9568752288818363
|
||||
558,oni,8.5,8.070021,0.4299793243408203
|
||||
291,oni,5.9,5.6488047,0.25119533538818395
|
||||
1250,oni,6.0,6.185741,0.18574094772338867
|
||||
367,oni,5.8,5.942817,0.14281721115112322
|
||||
1405,oni,10.3,9.006471,1.2935293197631843
|
||||
1204,oni,3.1,3.5766625,0.4766625404357909
|
||||
32,oni,6.8,6.5780144,0.22198562622070295
|
||||
98,oni,3.1,3.626054,0.5260540485382079
|
||||
437,oni,2.6,3.8291004,1.2291003704071044
|
||||
1033,oni,4.3,4.294703,0.005296993255615057
|
||||
844,oni,8.1,8.019684,0.08031616210937464
|
||||
1191,oni,5.4,5.417873,0.017872905731200817
|
||||
826,oni,10.5,9.921691,0.5783090591430664
|
||||
297,oni,6.0,5.827567,0.17243289947509766
|
||||
1070,oni,3.5,3.8753223,0.3753223419189453
|
||||
462,oni,7.3,6.147337,1.1526630401611326
|
||||
1100,oni,3.9,4.7135897,0.8135896682739259
|
||||
154,oni,7.7,7.755892,0.055891799926757635
|
||||
1334,oni,4.0,4.3223553,0.3223552703857422
|
||||
970,oni,7.2,7.4047165,0.20471649169921857
|
||||
43,oni,8.1,7.5882587,0.5117412567138668
|
||||
113,oni,5.7,5.523327,0.1766731262207033
|
||||
757,oni,10.5,9.775933,0.7240667343139648
|
||||
765,oni,11.9,10.6989155,1.2010845184326175
|
||||
1373,oni,2.1,3.1051126,1.0051125526428222
|
||||
1315,oni,5.9,6.302742,0.4027420043945309
|
||||
1390,oni,5.7,5.430671,0.26932878494262713
|
||||
1393,oni,5.2,5.470408,0.2704079627990721
|
||||
197,oni,1.7,3.4464536,1.7464535713195801
|
||||
1264,oni,7.5,7.588489,0.08848905563354492
|
||||
734,oni,8.6,8.141268,0.45873222351074183
|
||||
1252,oni,4.9,4.4269466,0.4730533599853519
|
||||
1274,oni,4.8,5.910712,1.1107117652893068
|
||||
1119,oni,5.2,4.7606645,0.4393355369567873
|
||||
1134,oni,9.6,8.895782,0.7042175292968746
|
||||
860,oni,10.6,9.677244,0.9227558135986325
|
||||
732,oni,2.4,2.9659953,0.5659953117370606
|
||||
256,oni,4.9,3.8098686,1.0901314258575443
|
||||
1404,oni,9.5,8.608601,0.8913993835449219
|
||||
5,oni,8.3,7.915822,0.3841779708862312
|
||||
264,oni,4.8,5.8318787,1.0318786621093752
|
||||
1144,oni,2.7,3.9332407,1.2332406520843504
|
||||
349,oni,6.8,7.0981984,0.29819841384887713
|
||||
910,oni,7.3,7.0472574,0.2527425765991209
|
||||
8,oni,2.2,3.9980168,1.798016834259033
|
||||
1096,oni,5.1,3.9809358,1.1190641880035397
|
||||
342,oni,4.8,6.7383738,1.9383737564086916
|
||||
821,oni,6.5,4.3094015,2.190598487854004
|
||||
1231,oni,5.7,4.9177494,0.7822505950927736
|
||||
259,oni,6.6,6.527813,0.07218704223632777
|
||||
1082,oni,5.0,5.1440825,0.14408254623413086
|
||||
750,oni,8.8,7.968265,0.8317349433898933
|
||||
1260,oni,8.8,7.968265,0.8317349433898933
|
||||
1365,oni,7.3,6.621416,0.6785839080810545
|
||||
517,oni,8.2,7.9367185,0.2632815361022942
|
||||
1383,oni,9.3,8.730703,0.5692966461181648
|
||||
140,oni,3.3,3.902748,0.6027481079101564
|
||||
1199,oni,4.3,2.8895078,1.4104922294616697
|
||||
857,oni,7.7,7.418688,0.28131217956542987
|
||||
677,oni,8.9,8.347812,0.5521883010864261
|
||||
991,oni,6.3,6.10526,0.1947401046752928
|
||||
512,oni,3.4,3.837741,0.4377408981323243
|
||||
1361,oni,1.5,3.2702508,1.7702507972717285
|
||||
333,oni,1.1,2.4639604,1.3639604091644286
|
||||
62,oni,6.1,5.3351364,0.7648635864257809
|
||||
1385,oni,3.2,3.4457886,0.24578862190246564
|
||||
1451,oni,5.1,5.803734,0.7037338256835941
|
||||
1013,oni,8.3,6.485044,1.8149559974670417
|
||||
160,oni,5.3,5.4540377,0.15403766632080096
|
||||
1083,oni,7.5,5.3125267,2.1874732971191406
|
||||
764,oni,11.2,9.98334,1.2166597366333
|
||||
81,oni,4.4,4.985347,0.5853467941284176
|
||||
745,oni,10.4,9.457144,0.9428562164306644
|
||||
874,oni,7.0,7.124093,0.12409305572509766
|
||||
1304,oni,4.7,4.7660456,0.06604557037353498
|
||||
173,oni,6.0,6.407813,0.40781307220458984
|
||||
363,oni,8.1,7.9964867,0.10351333618164027
|
||||
988,oni,5.3,7.1791115,1.8791114807128908
|
||||
1258,oni,4.6,4.581854,0.018146133422851207
|
||||
39,oni,5.6,6.2476506,0.6476506233215336
|
||||
770,oni,6.9,7.2992153,0.3992153167724606
|
||||
1211,oni,6.0,4.8941193,1.1058807373046875
|
||||
1130,oni,5.9,6.076717,0.17671689987182582
|
||||
1271,oni,4.8,4.005638,0.7943618774414061
|
||||
1112,oni,3.8,3.117308,0.6826920986175535
|
||||
818,oni,10.4,9.009138,1.3908618927001957
|
||||
270,oni,6.9,5.952505,0.9474948883056644
|
||||
233,oni,3.1,3.5813994,0.48139944076538077
|
||||
1409,oni,2.1,3.1322389,1.0322388648986816
|
||||
817,oni,8.0,8.098137,0.09813690185546875
|
||||
1314,oni,4.4,4.808567,0.40856704711914027
|
||||
1062,oni,5.0,4.040713,0.959287166595459
|
||||
400,oni,7.6,7.8508854,0.2508853912353519
|
||||
1452,oni,8.1,8.06595,0.03404960632324183
|
||||
3,oni,3.6,3.764412,0.16441192626953116
|
||||
520,oni,6.7,6.91257,0.21256999969482404
|
||||
1003,oni,5.1,3.142159,1.9578410148620602
|
||||
1057,oni,6.4,6.2039685,0.19603147506713903
|
||||
944,oni,7.0,6.1415854,0.8584146499633789
|
||||
156,oni,5.8,6.273828,0.47382802963256854
|
||||
1095,oni,6.2,4.935845,1.2641551017761232
|
||||
1353,oni,2.8,4.0457916,1.2457916259765627
|
||||
1020,oni,5.0,5.089527,0.08952713012695312
|
||||
799,oni,5.7,4.5762277,1.1237723350524904
|
||||
1251,oni,4.5,4.580452,0.08045196533203125
|
||||
17,oni,7.3,6.817699,0.48230104446411115
|
||||
1268,oni,6.3,6.331679,0.03167886734008807
|
||||
641,oni,8.4,8.34599,0.054009819030762074
|
||||
168,oni,8.6,8.051297,0.5487028121948239
|
||||
971,oni,10.3,9.249512,1.0504882812500007
|
||||
1027,oni,3.9,4.5194917,0.6194916725158692
|
||||
112,oni,6.5,6.4688077,0.031192302703857422
|
||||
177,oni,2.0,2.7901425,0.7901425361633301
|
||||
60,oni,7.9,8.010049,0.1100488662719723
|
||||
441,oni,10.7,9.515421,1.1845790863037102
|
||||
|
20
train.sh
20
train.sh
@@ -1,23 +1,25 @@
|
||||
#!/bin/bash
|
||||
# Arguments: script_dir working_dir data_dir train_data_count validate_data_count margin
|
||||
|
||||
# Arguments: script_dir working_dir data_dir train_count validate_count margin validate_iterations
|
||||
SCRIPT_DIR=${1:-"script"}
|
||||
WORKING_DIR=${2:-"."}
|
||||
DATA_DIR=${3:-"datas"}
|
||||
TRAIN_COUNT=${4:-100}
|
||||
VAL_COUNT=${5:-20}
|
||||
MARGIN=${6:-0.1}
|
||||
MARGIN=${6:-0.5}
|
||||
VAL_ITERATIONS=${7:-5}
|
||||
|
||||
# 작업 디렉토리가 없으면 생성
|
||||
if [ ! -d "$WORKING_DIR" ]; then
|
||||
echo "Creating directory: $WORKING_DIR"
|
||||
echo "Creating working directory: $WORKING_DIR"
|
||||
mkdir -p "$WORKING_DIR"
|
||||
fi
|
||||
|
||||
# 피처 추출 (존재 시 생략)
|
||||
if [ ! -f "$WORKING_DIR/features.json" ]; then
|
||||
echo "Extracting features..."
|
||||
bun "$SCRIPT_DIR/extract.ts" "$WORKING_DIR" "$DATA_DIR" "$TRAIN_COUNT" "$VAL_COUNT"
|
||||
# factors.json이 없으면 생성
|
||||
if [ ! -f "$WORKING_DIR/factors.json" ]; then
|
||||
echo "Factors file not found. Running factorization..."
|
||||
bun run "$SCRIPT_DIR/extract.ts" "$WORKING_DIR" "$DATA_DIR"
|
||||
fi
|
||||
|
||||
echo "Training model..."
|
||||
python3 "$SCRIPT_DIR/train.py" "$SCRIPT_DIR" "$WORKING_DIR" "$DATA_DIR" "$TRAIN_COUNT" "$VAL_COUNT" "$MARGIN"
|
||||
echo "Starting training..."
|
||||
python3 "$SCRIPT_DIR/train.py" "$SCRIPT_DIR" "$WORKING_DIR" "$DATA_DIR" "$TRAIN_COUNT" "$VAL_COUNT" "$MARGIN" "$VAL_ITERATIONS"
|
||||
|
||||
Reference in New Issue
Block a user