一、广播

1.机制

【logistic regression】04Python中广播“broadcasting”+numpy向量的说明

2.例子

【logistic regression】04Python中广播“broadcasting”+numpy向量的说明

二、numpy vectors

【logistic regression】04Python中广播“broadcasting”+numpy向量的说明

  • 不要用秩为1的array
  • 行向量或列向量使用np.random.randn(3,1)
  • assert确认是否为行向量
  • 使用reshape将秩为1数组转换成向量

相关文章: