Update modeling_super_linear.py
Browse files361 unmodified lines3623633643653663673683693703712 unmodified lines37437537637737837938039 unmodified lines420421422423424425361 unmodified lines# Get expert probabilities and convert to numpyprobs_np = expert_probs.detach().cpu().numpy()# Create a nicer figure with a modern styleplt.style.use('ggplot')fig, ax = plt.figure(figsize=(12, 8), dpi=120)ax = plt.subplot(111)# Create color gradient based on probability values2 unmodified lines# Plot bars with more attractive stylingbars = plt.bar(range(len(probs_np)), probs_np, color=colors, width=0.6,edgecolor='black', linewidth=0.5, alpha=0.85)# Add value annotations on top of each barfor i, bar in enumerate(bars):height = bar.get_height()39 unmodified linesplt.close()print(expert_probs.shape)if get_prob:expert_probs = F.softmax(self.gate_outputs, dim=1)print(expert_probs.shape)361 unmodified lines3623633643653663673683693703712 unmodified lines37437537637737837939 unmodified lines419420421422423424425361 unmodified lines# Get expert probabilities and convert to numpyprobs_np = expert_probs.detach().cpu().numpy()# Create a nicer figure with a modern styleplt.style.use('ggplot')plt.figure(figsize=(12, 8), dpi=120)plt.subplot(111)ax = plt.subplot(111)# Create color gradient based on probability values2 unmodified lines# Plot bars with more attractive stylingbars = plt.bar(range(len(probs_np)), probs_np, color=colors, width=0.6,edgecolor='black', linewidth=0.5, alpha=0.85)# Add value annotations on top of each barfor i, bar in enumerate(bars):height = bar.get_height()39 unmodified linesplt.close()print(expert_probs.shape)if get_prob:expert_probs = F.softmax(self.gate_outputs, dim=1)print(expert_probs.shape)
modeling_super_linear.py+3-3