我在使用python的机器学习中遇到了这些代码行。
z = np.linspace(-10, 10, 100)
# Compute sigmoid Activation function
A_sigmoid, z = sigmoid(z)
请问,第三行怎么说?基本上,我想知道如何在左侧用逗号分隔两个输入。从未预定义过A_sigmoid。
谢谢。
z = np.linspace(-10, 10, 100)
# Compute sigmoid Activation function
A_sigmoid, z = sigmoid(z)
答案 0 :(得分:1)
@Configuration
public class MapperConfig {
@Autowired private VoteService voteService;
@Bean
public ModelMapper modelMapper() {
ModelMapper mapper = new ModelMapper();
mapper.addConverter(toPollDTO());
return mapper;
}
private Converter<Poll, PollDTO> toPollDTO() {
return context -> {
Poll poll = context.getSource();
PollDTO dto = context.getDestination();
dto.setVotes(voteService.getVotesForPoll(poll.getId()));
// But this required mapping other fields manually too or they will be blank
return dto;
};
}
}
请注意,>>> t = (1, 2) # define a tuple
>>> a, b = t # unpack it
>>> print(a)
1
>>> print(b)
2
与a,b = t
相同。