diff --git a/.ci/setup.sh b/.ci/setup.sh index 18af055a53b..8bfbc714136 100755 --- a/.ci/setup.sh +++ b/.ci/setup.sh @@ -22,21 +22,25 @@ if [[ $OS_NAME == "macos" ]]; then wget -O conda.sh https://repo.continuum.io/miniconda/Miniconda${PYTHON_VERSION:0:1}-latest-MacOSX-x86_64.sh fi else # Linux + sudo apt-get update if [[ $AZURE == "true" ]] && [[ $COMPILER == "clang" ]]; then - update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-6.0 100 - update-alternatives --install /usr/bin/clang clang /usr/bin/clang-6.0 100 - sudo apt-get update + sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-6.0 100 + sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-6.0 100 sudo apt-get install libomp-dev + elif [[ $AZURE == "true" ]] && [[ $COMPILER == "gcc" ]] && [[ $TASK != "gpu" ]]; then + # downgrade gcc version + sudo apt-get remove -y gcc || exit -1 + sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y + sudo apt-get update + sudo apt-get install --no-install-recommends -y g++-4.8 || exit -1 + sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 100 + sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 100 fi if [[ $TASK == "mpi" ]]; then - if [[ $AZURE == "true" ]]; then - sudo apt-get update - fi - sudo apt-get install -y libopenmpi-dev openmpi-bin + sudo apt-get install --no-install-recommends -y libopenmpi-dev openmpi-bin fi if [[ $TASK == "gpu" ]]; then if [[ $AZURE == "true" ]]; then - sudo apt-get update sudo apt-get install --no-install-recommends -y libboost-dev libboost-system-dev libboost-filesystem-dev fi sudo apt-get install --no-install-recommends -y ocl-icd-opencl-dev diff --git a/.vsts-ci.yml b/.vsts-ci.yml index 24679d26e7c..ef29a30005b 100644 --- a/.vsts-ci.yml +++ b/.vsts-ci.yml @@ -53,7 +53,7 @@ phases: - bash: $(Build.SourcesDirectory)/.ci/test.sh displayName: Test - task: PublishBuildArtifacts@1 - condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/')) + condition: and(succeeded(), not(startsWith(variables['Build.SourceBranch'], 'refs/pull/'))) inputs: pathtoPublish: '$(Build.ArtifactStagingDirectory)' artifactName: PackageAssets @@ -64,7 +64,7 @@ phases: variables: COMPILER: clang queue: - name: 'Hosted macOS Preview' + name: 'Hosted macOS' parallel: 3 matrix: regular: @@ -97,7 +97,7 @@ phases: - bash: $(Build.SourcesDirectory)/.ci/test.sh displayName: Test - task: PublishBuildArtifacts@1 - condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/')) + condition: and(succeeded(), not(startsWith(variables['Build.SourceBranch'], 'refs/pull/'))) inputs: pathtoPublish: '$(Build.ArtifactStagingDirectory)' artifactName: PackageAssets @@ -128,7 +128,7 @@ phases: - powershell: $(Build.SourcesDirectory)/.ci/test_windows.ps1 displayName: Test - task: PublishBuildArtifacts@1 - condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/')) + condition: and(succeeded(), not(startsWith(variables['Build.SourceBranch'], 'refs/pull/'))) inputs: pathtoPublish: '$(Build.ArtifactStagingDirectory)' artifactName: PackageAssets @@ -141,7 +141,7 @@ phases: - Linux - MacOS - Windows - condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/')) + condition: and(succeeded(), not(startsWith(variables['Build.SourceBranch'], 'refs/pull/'))) queue: name: 'Hosted VS2017' steps: diff --git a/src/metric/regression_metric.hpp b/src/metric/regression_metric.hpp index 252ce7c1390..5007fbd76fa 100644 --- a/src/metric/regression_metric.hpp +++ b/src/metric/regression_metric.hpp @@ -252,7 +252,7 @@ class GammaMetric : public RegressionMetric { const double theta = -1.0 / score; const double a = psi; const double b = -std::log(-theta); - const double c = 1. / psi * std::log(label / psi) - std::log(label) - std::lgamma(1.0 / psi); + const double c = 1. / psi * std::log(label / psi) - std::log(label) - 0; // 0 = std::lgamma(1.0 / psi) = std::lgamma(1.0); return -((label * theta - b) / a + c); } inline static const char* Name() {