Spaces:
Sleeping
Sleeping
| import os | |
| # ========================================== | |
| # DEFENDER V5 - GLOBAL CONFIGURATION | |
| # ========================================== | |
| BASE_DIR = os.path.dirname(os.path.abspath(__file__)) | |
| CHECKPOINT_DIR = os.path.join(BASE_DIR, "checkpoints") | |
| MODEL_SAVE_PATH = os.path.join(CHECKPOINT_DIR, "phishing_gnn_master.pt") | |
| # Topology Definition | |
| NODE_TYPES = ['ip', 'domain', 'asn', 'cert'] | |
| EDGE_TYPES = [ | |
| ('domain', 'resolves_to', 'ip'), | |
| ('ip', 'hosted_on', 'asn'), | |
| ('domain', 'secured_by', 'cert'), | |
| ('cert', 'issued_to', 'ip'), | |
| ('domain', 'redirects_to', 'domain') | |
| ] | |
| GRAPH_METADATA = (NODE_TYPES, EDGE_TYPES) | |
| # Per-node-type input feature widths. Must stay in sync with the placeholder | |
| # tensor sizes TopologicalGraphEngine.extract_and_build() produces in | |
| # pipeline/graph_engine.py, and with whatever the checkpoint was trained on | |
| # (see train.py / app.py, which both use this exact mapping). | |
| IN_CHANNELS_DICT = {'ip': 16, 'domain': 32, 'asn': 8, 'cert': 16} | |
| # Model Deep-Stack Hyperparameters | |
| HIDDEN_CHANNELS = 128 | |
| NUM_HEADS = 8 | |
| NUM_LAYERS = 4 | |
| DROPOUT_RATE = 0.15 |