P0 + P1: ml_porosity package, audited F3 data, LOWO baselines, protocol v2
P0 - ml_porosity/: survey geometry, LAS/TDR/SEG-Y readers (4 ms delay fix, invalid time scalar, header LUT for incomplete cubes), anti-aliased log-to-time resampling, CNN-GRU v2 with the thesis loss, 41+ unit tests. - Full F3 Demo 2023 under data/ (text well/fault files tracked, bulk data ignored); the filtered copy and its cleanup notes are removed. - SHA-256 manifests for F3, Volve, NLOG and the thesis outputs. P1 - configs/protocol.yaml v2, locked by SHA-256 at 2026-10-26T04:28:09Z, before the first LOWO run (04:30:50Z); 05_lowo.py refuses to run on a hash mismatch. This commit postdates the runs. - Wavelet/synthetic tie QC, residual misregistration, LOWO 5 seeds for B0a, B0b, B1, B2, B3a, B3b (scripts 04-06); gate G-A: no pivot. - Volve D3: horizons, well picks, checkshots and the ST10010 cube read from data/Volve (scripts/07). - D-1 label check against measured NLOG density (scripts/08): PHIE_DT stays the primary label. - docs/plan.md, Volve and NLOG inventories, report.html. Full-text reference PDFs in refs/ stay local (ignored). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
36
ml_porosity/models/cnn_gru.py
Normal file
36
ml_porosity/models/cnn_gru.py
Normal file
@@ -0,0 +1,36 @@
|
||||
"""CNN (dilated) + GRU 2 tầng hai chiều + skip head 1×1.
|
||||
|
||||
Chuyển nguyên trạng từ `test 2/train_open_patch_v2.py` (lớp CNNGRU); không đổi kiến trúc.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import torch
|
||||
import torch.nn as nn
|
||||
|
||||
|
||||
class CNNGRU(nn.Module):
|
||||
def __init__(self, in_ch: int, d: int = 64, pdrop: float = 0.05):
|
||||
super().__init__()
|
||||
self.cnn = nn.Sequential(
|
||||
nn.Conv1d(in_ch, d, kernel_size=5, padding=2, dilation=1), nn.ReLU(),
|
||||
nn.Dropout(pdrop),
|
||||
nn.Conv1d(d, d, kernel_size=5, padding=4, dilation=2), nn.ReLU(),
|
||||
nn.Dropout(pdrop),
|
||||
nn.Conv1d(d, d, kernel_size=5, padding=8, dilation=4), nn.ReLU(),
|
||||
)
|
||||
self.gru = nn.GRU(
|
||||
input_size=d, hidden_size=d, num_layers=2,
|
||||
batch_first=True, bidirectional=True, dropout=0.0,
|
||||
)
|
||||
self.head = nn.Conv1d(2 * d, 1, kernel_size=1)
|
||||
self.head_skip = nn.Conv1d(in_ch, 1, kernel_size=1)
|
||||
self.bias = nn.Parameter(torch.zeros(1))
|
||||
|
||||
def forward(self, x: torch.Tensor) -> torch.Tensor:
|
||||
# x: (B, C, L) -> (B, 1, L)
|
||||
h = self.cnn(x)
|
||||
h2, _ = self.gru(h.transpose(1, 2))
|
||||
y_main = self.head(h2.transpose(1, 2))
|
||||
y_skip = self.head_skip(x)
|
||||
return y_main + y_skip + self.bias.view(1, 1, 1)
|
||||
Reference in New Issue
Block a user