kenchenxingyu commited on
Commit
b542ffd
·
verified ·
1 Parent(s): 16adafe

Re-upload model using PyTorch .bin format

Browse files
Files changed (3) hide show
  1. README.md +49 -0
  2. config.json +1 -0
  3. pytorch_model.bin +3 -0
README.md ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 🧠 Joint fMRI-Text Model
2
+ This model jointly predicts cognitive response type, trial type, and generates a 3D fMRI-like brain activation tensor based on natural language input and user-level metadata.
3
+
4
+ 🧩 Inputs
5
+ Text: a belief or statement in natural language (e.g., "Handwashing reduces disease risk."), processed using distilbert-base-uncased.
6
+
7
+ Metadata: a vector of 14 user features including:
8
+
9
+ Scaled continuous inputs: Age_scaled, Openness_scaled, Conscientiousness_scaled, Extraversion_scaled, Agreeableness_scaled, Neuroticism_scaled, ICAR_Total_scaled, MOCA_scaled, VMN_Sum_scaled
10
+
11
+ Encoded categorical features: Gender_encoded, Education_encoded, Ethnicity_fused_encoded, Income_level_encoded, VCBS_cat_encoded
12
+
13
+ 🎯 Outputs
14
+ Response Type: probabilities over 4 possible response categories
15
+
16
+ Trial Type: probabilities over 3 trial categories
17
+
18
+ fMRI Tensor: synthetic output of shape (74 × 74 × 52) representing brain activity across four timepoints
19
+
20
+ 🚀 Example Usage
21
+ from transformers import AutoTokenizer
22
+ from joint_fmri_model import JointFMRIModelWithHub
23
+ import torch
24
+
25
+ model = JointFMRIModelWithHub.from_pretrained("kenchenxingyu/joint-fmri-text-model")
26
+ tokenizer = AutoTokenizer.from_pretrained("distilbert-base-uncased")
27
+
28
+ text = "I think regular hand washing reduces disease risk."
29
+ inputs = tokenizer(text, return_tensors="pt", truncation=True, padding=True)
30
+
31
+ with torch.no_grad():
32
+ text_vec = model.text_encoder(inputs["input_ids"]).squeeze(0)
33
+
34
+ meta_input = torch.rand(1, 14) # Replace with realistic metadata
35
+
36
+ output = model(text_vec.unsqueeze(0), meta_input)
37
+
38
+ print("Response:", output["response_probs"])
39
+ print("Trial:", output["trial_probs"])
40
+ print("fMRI shape:", output["fmri"].shape)
41
+ 📂 Files
42
+ pytorch_model.bin: trained model weights
43
+
44
+ config.json: model configuration
45
+
46
+ README.md: this file
47
+
48
+ 🏷 License
49
+ This model is released under an open academic research license. For other use cases, please contact the author.
config.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"node_dim": 1, "text_dim": 768, "meta_dim": 14, "hidden_dim": 128, "num_nodes": 47, "num_response_classes": 4, "num_trial_classes": 3}
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:10d611eabe6e88f98c692dc40f1ab68451165f0db8921433e0c4c9f6318dcd46
3
+ size 1697992