Home | History | Annotate | Download | only in costs
      1 /* Copyright 2017 The TensorFlow Authors. All Rights Reserved.
      2 
      3 Licensed under the Apache License, Version 2.0 (the "License");
      4 you may not use this file except in compliance with the License.
      5 You may obtain a copy of the License at
      6 
      7     http://www.apache.org/licenses/LICENSE-2.0
      8 
      9 Unless required by applicable law or agreed to in writing, software
     10 distributed under the License is distributed on an "AS IS" BASIS,
     11 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     12 See the License for the specific language governing permissions and
     13 limitations under the License.
     14 ==============================================================================*/
     15 
     16 #ifndef TENSORFLOW_GRAPPLER_COSTS_ROBUST_STATS_H_
     17 #define TENSORFLOW_GRAPPLER_COSTS_ROBUST_STATS_H_
     18 
     19 #include <vector>
     20 namespace tensorflow {
     21 namespace grappler {
     22 class RobustStats {
     23  public:
     24   RobustStats(const std::vector<double>& values);
     25   RobustStats(std::vector<double>&& values);
     26 
     27   double lo() const { return lo_; }
     28   double hi() const { return hi_; }
     29   double mean() const { return mean_; }
     30 
     31  private:
     32   void HuberMAD(const std::vector<double>& values);
     33 
     34   double lo_;
     35   double hi_;
     36   double mean_;
     37   double stddev_;
     38 };
     39 }  // namespace grappler
     40 }  // namespace tensorflow
     41 
     42 #endif  // TENSORFLOW_GRAPPLER_COSTS_ROBUST_STATS_H_
     43