当您有两个变量作为输入时

时间:2019-07-10 15:55:58

标签: python

我在使用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)

1 个答案:

答案 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相同。