Questions tagged [accumulate]

Accumulation refers to the process of repeatedly combining the previously calculated result with the next item, until the supply of items is exhausted.

Accumulation refers to the process of repeatedly combining the previously calculated result with the next item, until the supply of items is exhausted.

When we are interested only in the final result, it is equivalent to left folding; and if we keep the whole sequence of results progressively calculated, it is known as left scan.

319 questions
-1
votes
0 answers

Attribute error in Adam optimizer? Adam has no attribute '_create_slots' when using Gradient Accumulation

I try to fit my model with GradientAccumulateOptimizer, but getting errors when setting it up. Does anyone know how to use it correctly? history = model.fit([X_train, y_train], y_train, validation_data=([X_test, y_test],…
-1
votes
2 answers

Why this for loop results zero

I am writing a for loop accumulation in R. Why the final result is zero? Is there anything I can do to fix it? thanks. mse =numeric() for (i in 1:nrow(m1$v)){ i_d = 128-i for (j in 1:ncol(m1$v)){ j_d = 128-j lam_hij =…
-1
votes
1 answer

Create a list of element from a vector with an incrementation of specified number of element from the vector itself

I already posted a related question (Create a new vector by appending elements between them in R). I would like to know whether it's possible to increment a vector with a specified number of elements (like accumulate() from purr package). In fact,…
SHADJI
  • 1
  • 1
-1
votes
1 answer

C++ trying to use max and accumulate function

I am new to C++ and this is my first program that I am trying to write. In the below code I want to simulate a price of an option and calculate its value. I am getting an error for the accumulate function. I have already tried std::max and…
Varun Yadav
  • 43
  • 2
  • 11
-1
votes
4 answers

C Programming: Sum of a sequence of integers until zero and prints the sum of two multiplied integers

I'm currently working on code that reads in a sequence of integers in the form of m1, n1, m2, n2, until I input a zero, and it prints the sum of m * n. Here is what I have so far: #include #include #include int…
-1
votes
1 answer

Excel - Mind numbing issue- Form based league standing

Based on football data I am looking to create a league table which will give rankings of all the teams, the only difference is, each game week, teams will earn points based on the current ranking of the team they are playing. So week by week, the…
-1
votes
1 answer

Drools accumulate

Could someone please help me with this accumulate function accumulate ($sum: Repetition(objectId == getEventKey(), "VERY_LONG".equals(getRepType())); $count: count($sum); $count== $vlongCount) though the $count=10 and vlongcount=11 accumulate…
veena rao
  • 1
  • 3
-1
votes
1 answer

I need a help to solve Hackerrank's data structure challenge

I was trying to solve a data structure question from Hackerrank and i could not figure it out. Actually, i could not understand exact logic lying under problem.Below is a link to question question. https://www.hackerrank.com/challenges/crush
-1
votes
2 answers

Accumulate values of duplicate items within a list

I'm trying to figure out a way to remove the "duplicate" tuples from my list while also accumulating their "values". The tricky part is that they're not necessary true duplicates nor true values so what's the best approach? Would it be easier to…
deedle
  • 105
  • 11
-1
votes
2 answers

using accumulate to sum 12 numbers at a time from one vector and then adding the result to another vector C++

I am wanting to sum 12 numbers at a time(to simulate a year) then adding the results to a separate vector but I seem to be struggling. I have tried to get 12 numbers at a time into a loop but I'm unsure. Here is a sample from the text file i'm…
louiej15
  • 61
  • 7
-1
votes
1 answer

Converting CSV data format

First time question here.. I have 100's of CSV files I need to convert using whatever means you think necessary. The format is an ever-accumulating value…
user2819573
  • 161
  • 1
  • 9
-2
votes
4 answers

MariaDB / MySQL: Partial "total" number of rows for moving time-window

I have a MariaDB Database with Users and their appropriate registration date, something like: +----+----------+----------------------+ | ID | Username | RegistrationDatetime | +----+----------+----------------------+ | 1 | A | 2022-01-03…
tim
  • 9,896
  • 20
  • 81
  • 137
-2
votes
2 answers

PowerQuery: Adding multiple columns with calculation

I have a data model with two tables sharing the same columns. I have merged the tables using the prefixes "Old." and "New." I'd like to add a calculated column for each column that shows if the values are different with the name like…
kami
  • 244
  • 1
  • 3
  • 16
-2
votes
2 answers

Cumulative maximum of any iterable with a list comprehension

Another question asked to compute cumulative maximum of a list in a list comprehension, e.g.: input: [3, 4, 2, 8, 9, 3, 3, 4, 20, 1] output: [3, 4, 4, 8, 9, 9, 9, 9, 20, 20] I came up with a decent list comprehension there as requested, but it…
Kelly Bundy
  • 23,480
  • 7
  • 29
  • 65
-2
votes
2 answers

using accumulate in C++ with a const function as parameter

I couldnt find any solution, so Im posting a new topic. I have to use accumulate with a const function as a parameter (doing some practice for a test): get_skills() - returns a list of skills and is defined as: const vector& get_skills()…
1 2 3
21
22